|
1 | 1 | // import R from 'ramda' |
2 | 2 | // import Router from 'next/router' |
3 | | -import { |
4 | | - asyncRes, |
5 | | - asyncErr, |
6 | | - buildLog, |
7 | | - $solver, |
8 | | - ERR, |
9 | | - EVENT, |
10 | | - TYPE, |
11 | | - dispatchEvent, |
12 | | -} from '@utils' |
13 | | - |
14 | | -import SR71 from 'utils/network/sr71' |
| 3 | +import { asyncSuit, buildLog, ERR, EVENT, TYPE, send } from '@utils' |
15 | 4 |
|
16 | 5 | import S from './schema' |
17 | 6 |
|
18 | | -const sr71$ = new SR71({ |
19 | | - resv_event: [EVENT.PREVIEW_CLOSE], |
20 | | -}) |
21 | 7 | /* eslint-disable no-unused-vars */ |
22 | 8 | const log = buildLog('L:communitiesBanner') |
23 | 9 | /* eslint-enable no-unused-vars */ |
24 | 10 |
|
| 11 | +const { SR71, asyncRes, asyncErr, $solver } = asyncSuit |
| 12 | +const sr71$ = new SR71({ |
| 13 | + recieve: [EVENT.PREVIEW_CLOSE], |
| 14 | +}) |
| 15 | + |
25 | 16 | let store = null |
26 | 17 | let sub$ = null |
27 | 18 |
|
@@ -55,23 +46,23 @@ export const loadCategories = () => |
55 | 46 | export function onAdd(thread) { |
56 | 47 | switch (thread) { |
57 | 48 | case 'tags': { |
58 | | - return dispatchEvent(EVENT.NAV_CREATE_TAG, { |
| 49 | + return send(EVENT.NAV_CREATE_TAG, { |
59 | 50 | type: TYPE.PREVIEW_CREATE_TAG, |
60 | 51 | }) |
61 | 52 | } |
62 | 53 | case 'categories': { |
63 | | - return dispatchEvent(EVENT.NAV_CREATE_CATEGORY, { |
| 54 | + return send(EVENT.NAV_CREATE_CATEGORY, { |
64 | 55 | type: TYPE.PREVIEW_CREATE_CATEGORY, |
65 | 56 | }) |
66 | 57 | } |
67 | 58 | case 'threads': { |
68 | | - return dispatchEvent(EVENT.NAV_CREATE_THREAD, { |
| 59 | + return send(EVENT.NAV_CREATE_THREAD, { |
69 | 60 | type: TYPE.PREVIEW_CREATE_THREAD, |
70 | 61 | }) |
71 | 62 | } |
72 | 63 | default: { |
73 | 64 | log('onAdd default: ', thread) |
74 | | - return dispatchEvent(EVENT.NAV_CREATE_COMMUNITY, { |
| 65 | + return send(EVENT.NAV_CREATE_COMMUNITY, { |
75 | 66 | type: TYPE.PREVIEW_CREATE_COMMUNITY, |
76 | 67 | }) |
77 | 68 | } |
|
0 commit comments