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
reducer.js
20 lines
| 1 | import dispatchers from './dispatchers'; |
| 2 | |
| 3 | const DEFAULT_STATE = { |
| 4 | currentRequest: { |
| 5 | id: - 1, |
| 6 | }, |
| 7 | currentGateway: {}, |
| 8 | currentScenario: {}, |
| 9 | eventTypes: [], |
| 10 | }; |
| 11 | |
| 12 | export default function ( state = DEFAULT_STATE, action ) { |
| 13 | const callback = dispatchers[ action?.type ]; |
| 14 | |
| 15 | if ( callback ) { |
| 16 | return callback( state, action ); |
| 17 | } |
| 18 | |
| 19 | return state; |
| 20 | } |