Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}
}
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;
}
}