Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit d7d6401

Browse files
committed
refactor(import): mv network staff to asyncSuit
1 parent 8d1100c commit d7d6401

File tree

39 files changed

+230
-378
lines changed

39 files changed

+230
-378
lines changed

containers/AccountEditor/logic.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import R from 'ramda'
22

33
import {
4-
asyncRes,
5-
asyncErr,
4+
asyncSuit,
65
buildLog,
7-
$solver,
86
send,
97
EVENT,
108
ERR,
119
TYPE,
1210
meteorState,
1311
} from '@utils'
14-
import SR71 from 'utils/network/sr71'
12+
1513
import S from './schema'
1614

15+
const { SR71, $solver, asyncRes, asyncErr } = asyncSuit
1716
const sr71$ = new SR71()
1817

1918
/* eslint-disable no-unused-vars */

containers/AccountViewer/logic.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
// import R from 'ramda'
2-
import {
3-
asyncRes,
4-
asyncErr,
5-
buildLog,
6-
$solver,
7-
ERR,
8-
send,
9-
EVENT,
10-
TYPE,
11-
Global,
12-
} from '@utils'
13-
14-
import SR71 from 'utils/network/sr71'
2+
import { asyncSuit, buildLog, ERR, send, EVENT, TYPE, Global } from '@utils'
3+
154
import S from './schema'
165

176
/* eslint-disable no-unused-vars */
187
const log = buildLog('L:AccountViewer')
198
/* eslint-enable no-unused-vars */
209

10+
const { SR71, $solver, asyncRes, asyncErr } = asyncSuit
2111
const sr71$ = new SR71({
2212
recieve: [EVENT.LOGIN],
2313
})

containers/ArticleViwer/logic.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import R from 'ramda'
22

3-
import SR71 from 'utils/network/sr71'
4-
import { asyncRes, buildLog, EVENT, TYPE } from '@utils'
3+
import { asyncSuit, buildLog, EVENT, TYPE } from '@utils'
54
import S from './schema'
65

7-
const sr71$ = new SR71({
8-
recieve: [EVENT.PREVIEW_POST, EVENT.PREVIEW_CLOSED],
9-
})
10-
116
/* eslint-disable no-unused-vars */
127
const log = buildLog('L:ArticleViwer')
138
/* eslint-enable no-unused-vars */
149

10+
const { SR71, asyncRes } = asyncSuit
11+
const sr71$ = new SR71({
12+
recieve: [EVENT.PREVIEW_POST, EVENT.PREVIEW_CLOSED],
13+
})
14+
1515
let store = null
1616
let sub$ = null
1717

containers/Banner/logic.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// import R from 'ramda'
22

3-
import { buildLog, $solver } from '@utils'
4-
import SR71 from 'utils/network/sr71'
5-
6-
const sr71$ = new SR71()
7-
let sub$ = null
3+
import { asyncSuit, buildLog, $solver } from '@utils'
84

95
/* eslint-disable no-unused-vars */
106
const log = buildLog('L:Banner')
117
/* eslint-enable no-unused-vars */
128

9+
const { SR71 } = asyncSuit
10+
const sr71$ = new SR71()
11+
12+
let sub$ = null
1313
let store = null
1414

1515
export function someMethod() {}

containers/CategoryEditor/logic.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import R from 'ramda'
22

3-
import { asyncRes, TYPE, buildLog, closePreviewer, $solver, cast } from '@utils'
4-
import SR71 from 'utils/network/sr71'
3+
import { asyncSuit, TYPE, buildLog, closePreviewer, cast } from '@utils'
54
import S from './schema'
65

7-
const sr71$ = new SR71()
8-
let sub$ = null
9-
106
/* eslint-disable no-unused-vars */
117
const log = buildLog('L:CategoryEditor')
128
/* eslint-enable no-unused-vars */
139

10+
const { SR71, asyncRes, $solver } = asyncSuit
11+
const sr71$ = new SR71()
12+
13+
let sub$ = null
1414
let store = null
1515

1616
export const profileChange = R.curry((thread, e) =>

containers/CategorySetter/logic.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import R from 'ramda'
22

3-
import { buildLog, $solver, TYPE, asyncRes, closePreviewer } from '@utils'
3+
import { asyncSuit, buildLog, TYPE, closePreviewer } from '@utils'
44
import { PAGE_SIZE } from '@config'
55

6-
import SR71 from 'utils/network/sr71'
76
import S from './schema'
87

9-
const sr71$ = new SR71()
10-
let sub$ = null
11-
128
/* eslint-disable no-unused-vars */
139
const log = buildLog('L:CategorySetter')
1410
/* eslint-enable no-unused-vars */
1511

12+
const { SR71, asyncRes, $solver } = asyncSuit
13+
const sr71$ = new SR71()
14+
let sub$ = null
15+
1616
let store = null
1717

1818
const commonFilter = page => {

containers/Comments/logic.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
import R from 'ramda'
22
import {
3-
asyncRes,
4-
asyncErr,
3+
asyncSuit,
54
buildLog,
65
EVENT,
76
ERR,
87
TYPE,
9-
$solver,
108
scrollIntoEle,
119
countWords,
1210
send,
1311
extractMentions,
1412
} from '@utils'
1513

1614
import { PAGE_SIZE } from '@config'
17-
import SR71 from 'utils/network/sr71'
1815
import S from './schema'
1916

20-
const sr71$ = new SR71()
21-
let sub$ = null
22-
2317
/* eslint-disable no-unused-vars */
2418
const log = buildLog('L:Comments')
2519
/* eslint-enable no-unused-vars */
2620

21+
const { SR71, asyncRes, asyncErr, $solver } = asyncSuit
22+
const sr71$ = new SR71()
23+
24+
let sub$ = null
2725
let store = null
2826

2927
/* DESC_INSERTED, ASC_INSERTED */

containers/CommunitiesBanner/logic.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
// import R from 'ramda'
22
// import Router from 'next/router'
3-
import {
4-
asyncRes,
5-
asyncErr,
6-
buildLog,
7-
$solver,
8-
ERR,
9-
EVENT,
10-
TYPE,
11-
send,
12-
} from '@utils'
13-
14-
import SR71 from 'utils/network/sr71'
3+
import { asyncSuit, buildLog, ERR, EVENT, TYPE, send } from '@utils'
154

165
import S from './schema'
176

18-
const sr71$ = new SR71({
19-
recieve: [EVENT.PREVIEW_CLOSE],
20-
})
217
/* eslint-disable no-unused-vars */
228
const log = buildLog('L:communitiesBanner')
239
/* eslint-enable no-unused-vars */
2410

11+
const { SR71, asyncRes, asyncErr, $solver } = asyncSuit
12+
const sr71$ = new SR71({
13+
recieve: [EVENT.PREVIEW_CLOSE],
14+
})
15+
2516
let store = null
2617
let sub$ = null
2718

containers/CommunitiesContent/logic.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { message } from 'antd'
55
import { PAGE_SIZE } from '@config'
66

77
import {
8-
asyncRes,
9-
asyncErr,
10-
$solver,
8+
asyncSuit,
119
ERR,
1210
buildLog,
1311
EVENT,
@@ -19,9 +17,13 @@ import {
1917
send,
2018
} from '@utils'
2119

22-
import SR71 from 'utils/network/sr71'
2320
import S from './schema'
2421

22+
/* eslint-disable no-unused-vars */
23+
const log = buildLog('L:CommunitiesContent')
24+
/* eslint-enable no-unused-vars */
25+
26+
const { SR71, asyncRes, asyncErr, $solver } = asyncSuit
2527
const sr71$ = new SR71({
2628
recieve: [
2729
EVENT.LOGOUT,
@@ -31,10 +33,6 @@ const sr71$ = new SR71({
3133
],
3234
})
3335

34-
/* eslint-disable no-unused-vars */
35-
const log = buildLog('L:CommunitiesContent')
36-
/* eslint-enable no-unused-vars */
37-
3836
let sub$ = null
3937
let store = null
4038

containers/CommunityBanner/logic.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// import R from 'ramda'
22

3-
import { buildLog, asyncRes, $solver } from '@utils'
4-
import SR71 from 'utils/network/sr71'
3+
import { asyncSuit, buildLog, $solver } from '@utils'
54

65
import S from './schema'
76

8-
const sr71$ = new SR71()
9-
let sub$ = null
10-
117
/* eslint-disable no-unused-vars */
128
const log = buildLog('L:CommunityBanner')
139
/* eslint-enable no-unused-vars */
1410

11+
const { SR71, asyncRes } = asyncSuit
12+
const sr71$ = new SR71()
13+
14+
let sub$ = null
1515
let store = null
1616

1717
export function loadPosts() {

0 commit comments

Comments
 (0)