1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import { bindActionCreators } from 'redux'
import { actions as crudActions } from './api'
import * as taskActions from './task/task.actions'
import * as liveActions from './live/live.actions'
import * as systemActions from './system/system.actions'
import * as socketActions from './socket/socket.actions'
import * as datasetActions from './dataset/dataset.actions'
import { dispatch } from './store'
export default
Object.keys(crudActions)
.map(a => [a, crudActions[a]])
.concat([
['task', taskActions],
['live', liveActions],
['system', systemActions],
['dataset', datasetActions],
])
.map(p => [p[0], bindActionCreators(p[1], dispatch)])
.concat([
['socket', socketActions],
])
.reduce((a,b) => (a[b[0]] = b[1])&&a,{})
|