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
selectors.js
30 lines
| 1 | const selectors = { |
| 2 | getCurrentRequestId( state ) { |
| 3 | return state.currentRequest.id; |
| 4 | }, |
| 5 | getCurrentRequest( state ) { |
| 6 | return state.currentRequest; |
| 7 | }, |
| 8 | getScenario( state ) { |
| 9 | return state.currentScenario; |
| 10 | }, |
| 11 | getScenarioId( state ) { |
| 12 | return state.currentScenario?.id; |
| 13 | }, |
| 14 | getGatewayId( state ) { |
| 15 | return state.currentGateway?.gateway; |
| 16 | }, |
| 17 | getGateway( state ) { |
| 18 | return state.currentGateway; |
| 19 | }, |
| 20 | getEventTypes( state ) { |
| 21 | return state.eventTypes; |
| 22 | }, |
| 23 | }; |
| 24 | |
| 25 | export default { |
| 26 | ...selectors, |
| 27 | getGatewaySpecific( state ) { |
| 28 | return state.currentGateway[ selectors.getGatewayId( state ) ] || {}; |
| 29 | }, |
| 30 | } |