(store, options)
| 2 | import { forin } from '../../utils/forin'; |
| 3 | |
| 4 | export const createOptionAPI = (store, options) => { |
| 5 | const obj = {}; |
| 6 | forin(options, key => { |
| 7 | obj[key] = { |
| 8 | get: () => store.getState().options[key], |
| 9 | set: value => { |
| 10 | store.dispatch(`SET_${fromCamels(key, '_').toUpperCase()}`, { |
| 11 | value |
| 12 | }); |
| 13 | } |
| 14 | }; |
| 15 | }); |
| 16 | return obj; |
| 17 | }; |
no test coverage detected