Direktori : /home/brasafestival/www/old/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/global-notices/store/ |
Current File : /home/brasafestival/www/old/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-wordads/src/dashboard/components/global-notices/store/reducer.js |
import { CREATE_NOTICE, REMOVE_NOTICE } from './actions'; const notices = ( state = { notices: [] }, action ) => { switch ( action.type ) { case CREATE_NOTICE: return { ...state, notices: [ ...state.notices, action.notice ], }; case REMOVE_NOTICE: return { ...state, notices: state.notices.filter( notice => notice.id !== action.notice.id ), }; } return state; }; export default notices;