-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
63 lines (54 loc) · 1.2 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
process.env.FORCE_COLOR = 3
// Include this import before other local imports.
require('better-module-alias')(__dirname)
const fetch = require('node-fetch')
const { applyMiddleware, createStore } = require('redux')
const { createActionLoggerMiddleware } = require('@redux-observable-backend/redux-utils')
const { createConfigurationSet, runTasks } = require('@redux-observable-backend/node')
const { createEpicMiddleware } = require('redux-observable')
const { createHttpServers, createWebSocketServers } = require('@redux-observable-backend/websocket')
const { of } = require('rxjs')
const { tap } = require('rxjs/operators')
const {
rootEpic,
rootReducer,
} = require('$redux')
require('./')
const actionLoggerMiddleware = (
createActionLoggerMiddleware()
)
const epicMiddleware = (
createEpicMiddleware({
dependencies: {
fetch,
},
})
)
const middleware = (
applyMiddleware(
actionLoggerMiddleware,
epicMiddleware
)
)
const store = (
createStore(
rootReducer,
middleware,
)
)
epicMiddleware
.run(rootEpic)
of(store)
.pipe(
tap(createConfigurationSet({})),
tap(createHttpServers()),
tap(createWebSocketServers()),
tap(
runTasks(
'lint',
'serve',
'listen',
)
),
)
.subscribe()