How to use the storejs.get function in storejs

To help you get started, we’ve selected a few storejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fygethub / react-demo-storybook / src / redux / reducer.js View on Github external
export const chaptersList = (state = {}, action) => {
    switch (action.type){
        case ADD_CHAPTERS_LIST:{
            let focusBooks = storejs.get("focusBooks") || [];
            focusBooks.push()
            return action.chapters;
        }
        default:
            return state;
    }
}
github fygethub / react-demo-storybook / src / redux / reducer.js View on Github external
export const historyList = (state = [], action = '') => {
    var historyListArr = storejs.get("historyListArr") || [];
    switch (action.type){
        case ADD_SEARCH_HISTORY:
            //添加搜索记录缓存

            if(action.bookName === '' || !action.bookName){
                if(state.length === 0){
                    return historyListArr;
                }
                return state;
            }
            if(state.length >= 1){
               let has = isInArr(state,[action.bookName]);
                if(has){
                    return state;
                }
            }

storejs

Local storage localstorage package provides a simple API

MIT
Latest version published 1 month ago

Package Health Score

72 / 100
Full package analysis

Popular storejs functions