actions.js
2 years ago
constants.js
2 years ago
dispatchers.js
2 years ago
index.js
2 years ago
reducer.js
2 years ago
selectors.js
2 years ago
dispatchers.js
23 lines
| 1 | import constants from './constants'; |
| 2 | |
| 3 | const dispatchers = { |
| 4 | [ constants.register ]( state, action ) { |
| 5 | const { |
| 6 | messages, |
| 7 | ssr_callbacks, |
| 8 | formats, |
| 9 | rule_types, |
| 10 | } = action.items; |
| 11 | |
| 12 | state.messages = JSON.parse( JSON.stringify( messages ) ); |
| 13 | state.ssrCallbacks = JSON.parse( JSON.stringify( ssr_callbacks ) ); |
| 14 | state.formats = JSON.parse( JSON.stringify( formats ) ); |
| 15 | state.ruleTypes = JSON.parse( JSON.stringify( rule_types ) ); |
| 16 | |
| 17 | return state; |
| 18 | }, |
| 19 | }; |
| 20 | |
| 21 | export default { |
| 22 | ...dispatchers, |
| 23 | }; |