This repository was archived by the owner on Nov 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
Not all actions are being saved. #179
Copy link
Copy link
Open
Description
Despite the setup as below with no blacklisted or whitelisted actions, once I dispatch sertain actions all saving stops for the entire app.
const reducer = storage.reducer(combineReducers({
menu: menuReducer,
axios: axiosReducer,
admin: combineReducers({
storage: storageReducer,
classes: classesReducer,
classEdit: classEditReducer,
classEditStudents: classEditStudentsReducer,
deleteConfirm: deleteConfirmReducer,
actionConfirm: actionConfirmReducer,
saveDialog: saveDialogReducer,
admins: adminsReducer,
adminEdit: adminEditReducer,
students: studentsReducer,
studentView: studentViewReducer
})
}));
const engine = createEngine('vs45tgfr5678ikhy');
const middleware = [thunk, storage.createMiddleware(engine)];
const store = createStore(
reducer,
applyMiddleware(...middleware)
);
const load = storage.createLoader(engine);
load(store);
load(store)
.then((newState) => console.log('STATE LOADED FROM INDEXED D:', newState))
.catch(() => console.log('Failed to load previous state from local db!'));
export default store;
Fails on anything dispatched in the deleteConfirm:
let initialState = {
show: false,
action: null,
params: null,
item: null
};
const deleteConfirmReducer = (state = initialState, action) => {
let newState = {};
let data = action.payload;
switch (action.type) {
case 'DELETE_CONFIRM_HIDE':
newState = Object.assign({}, state);
newState = {
show: false,
action: state.action,
params: state.params,
item: state.item
};
return newState;
case 'DELETE_CONFIRM_UPDATE':
newState = Object.assign({}, state);
newState = {
show: true,
action: (!data.action) ? null : data.action,
params: (!data.params) ? null : data.params,
item: (!data.item) ? null : data.item
};
return newState;
case 'DELETE_CONFIRM_RESET':
newState = Object.assign({}, state);
newState = {
show: false,
action: null,
params: null,
item: null
};
return newState;
default:
return state;
}
};
export default deleteConfirmReducer;
I cannot seem to find anything as to why.
Metadata
Metadata
Assignees
Labels
No labels