How to clear (reset) all data in dav.js

topic description

how to clear (reset) all data in dav.js

sources of topics and their own ideas

the project is now large and there is a lot of mdels data in dav. How to reset all current store data after exiting?

davgithub

Jul.07,2021

take the official example:

const initialState = [];
export default {
  namespace: 'products',
  state: initialState,
  reducers: {
    'delete'(state, { payload: id }) {
      return state.filter(item => item.id !== id);
    },
  },
};

the data that needs to be reproduced is:

const initialState = [];
export default {
  namespace: 'products',
  state: initialState,
  reducers: {
    'delete'(state, { payload: id }) {
      return state.filter(item => item.id !== id);
    },
    'reset'(state) {
      return state = initialState;
    }
  },
};
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3505f-2b6da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3505f-2b6da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?