Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit5a384e7

Browse files
committed
refactor(rename): dispatchEvent -> send
1 parent1709376 commit5a384e7

File tree

41 files changed

+123
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+123
-150
lines changed

‎containers/AccountEditor/logic.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TYPE, EVENT, ERR } from '@constant'
55
import{
66
buildLog,
77
asyncSuit,
8-
dispatchEvent,
8+
send,
99
cast,
1010
meteorState,
1111
updateEditing,
@@ -25,7 +25,7 @@ let store = null
2525
letsub$=null
2626

2727
exportconstgoBack=()=>
28-
dispatchEvent(EVENT.PREVIEW_OPEN,{type:TYPE.PREVIEW_ACCOUNT_VIEW})
28+
send(EVENT.PREVIEW_OPEN,{type:TYPE.PREVIEW_ACCOUNT_VIEW})
2929

3030
exportconstinputOnChange=R.curry((part,e)=>updateEditing(store,part,e))
3131
/* eslint-disable no-unused-vars */
@@ -93,7 +93,7 @@ export const updateConfirm = () => {
9393
sr71$.mutate(S.updateProfile,args)
9494
}
9595

96-
exportconstcancleEdit=()=>dispatchEvent(EVENT.PREVIEW_CLOSE)
96+
exportconstcancleEdit=()=>send(EVENT.PREVIEW_CLOSE)
9797

9898
exportconstupdateDone=()=>{
9999
constediting=cast(updateFields,store.editUserData)

‎containers/AccountViewer/logic.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import{useEffect}from'react'
33

44
import{TYPE,EVENT,ERR}from'@constant'
5-
import{asyncSuit,buildLog,dispatchEvent,Global,errRescue}from'@utils'
5+
import{asyncSuit,buildLog,send,Global,errRescue}from'@utils'
66

77
importSfrom'./schema'
88

@@ -29,19 +29,19 @@ export const loadUser = user => {
2929

3030
exportconstchangeTheme=name=>{
3131
store.changeTheme(name)
32-
dispatchEvent(EVENT.SET_C11N,{data:{theme:name}})
32+
send(EVENT.SET_C11N,{data:{theme:name}})
3333
}
3434

3535
exportconsteditProfile=()=>
36-
dispatchEvent(EVENT.PREVIEW_OPEN,{type:TYPE.PREVIEW_ACCOUNT_EDIT})
36+
send(EVENT.PREVIEW_OPEN,{type:TYPE.PREVIEW_ACCOUNT_EDIT})
3737

3838
exportconstonLogout=()=>{
3939
store.logout()
4040

4141
setTimeout(()=>{
4242
Global.location.reload(false)
4343
},2000)
44-
//dispatchEvent(EVENT.LOGOUT)
44+
//send(EVENT.LOGOUT)
4545
}
4646

4747
// ###############################

‎containers/ArticleAuthorCard/logic.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import{useEffect}from'react'
33

44
import{EVENT,ERR}from'@constant'
5-
import{asyncSuit,buildLog,dispatchEvent,errRescue}from'@utils'
5+
import{asyncSuit,buildLog,send,errRescue}from'@utils'
66

77
importSfrom'./schema'
88

@@ -24,7 +24,7 @@ export const loadUser = user => {
2424
}
2525

2626
exportconstonListUsers=(type,data)=>
27-
dispatchEvent(EVENT.USER_LISTER_OPEN,{ type, data})
27+
send(EVENT.USER_LISTER_OPEN,{ type, data})
2828

2929
exportconstonFollow=userId=>{
3030
store.markState({following:true})

‎containers/ArticleBanner/logic.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import R from 'ramda'
22
import{useEffect}from'react'
33

44
import{TYPE,EVENT,ERR,THREAD}from'@constant'
5-
import{asyncSuit,buildLog,dispatchEvent,errRescue}from'@utils'
5+
import{asyncSuit,buildLog,send,errRescue}from'@utils'
66

77
importSfrom'./schema'
88

@@ -26,7 +26,7 @@ export const onReaction = (action, userDid, { id }) => {
2626
/* log('onReaction thread: ', thread) */
2727
if(action===TYPE.FAVORITE){
2828
// call favoriteSetter
29-
returndispatchEvent(EVENT.SET_FAVORITE_CONTENT,{
29+
returnsend(EVENT.SET_FAVORITE_CONTENT,{
3030
data:{ thread},
3131
})
3232
}
@@ -40,7 +40,7 @@ export const onReaction = (action, userDid, { id }) => {
4040
}
4141

4242
exportconstonListReactionUsers=(type,data)=>
43-
dispatchEvent(EVENT.USER_LISTER_OPEN,{
43+
send(EVENT.USER_LISTER_OPEN,{
4444
type,
4545
data:{ ...data,thread:store.activeThread},
4646
})

‎containers/ArticleBodyHeader/logic.js‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ import R from 'ramda'
22
import{useEffect}from'react'
33

44
import{TYPE,EVENT,ERR,THREAD}from'@constant'
5-
import{
6-
asyncSuit,
7-
buildLog,
8-
dispatchEvent,
9-
closePreviewer,
10-
errRescue,
11-
}from'@utils'
5+
import{asyncSuit,buildLog,send,closePreviewer,errRescue}from'@utils'
126

137
importSfrom'./schema'
148

@@ -35,17 +29,17 @@ export const onEdit = thread => {
3529
break
3630

3731
caseTHREAD.REPO:
38-
returndispatchEvent(EVENT.SYNC_REPO)
32+
returnsend(EVENT.SYNC_REPO)
3933

4034
default:{
4135
type=TYPE.PREVIEW_POST_EDIT
4236
}
4337
}
4438

45-
dispatchEvent(EVENT.PREVIEW_OPEN,{ type, data})
39+
send(EVENT.PREVIEW_OPEN,{ type, data})
4640
}
4741

48-
exportconstonCommunitySet=()=>dispatchEvent(EVENT.COMMUNITY_MIRROR)
42+
exportconstonCommunitySet=()=>send(EVENT.COMMUNITY_MIRROR)
4943

5044
exportconstonPin=thread=>{
5145
constargs={
@@ -163,7 +157,7 @@ const backToParentThread = () => {
163157
REFRESH_EVENT=EVENT.REFRESH_REPOS
164158
}
165159

166-
dispatchEvent(REFRESH_EVENT)
160+
send(REFRESH_EVENT)
167161
closePreviewer()
168162
store.setViewing({post:{},job:{},repo:{},video:{}})
169163
}

‎containers/ArticleViewerHeader/logic.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import R from 'ramda'
22
import{useEffect}from'react'
33

44
import{TYPE,EVENT,ERR,THREAD}from'@constant'
5-
import{asyncSuit,buildLog,dispatchEvent,errRescue}from'@utils'
5+
import{asyncSuit,buildLog,send,errRescue}from'@utils'
66

77
importSfrom'./schema'
88

@@ -29,7 +29,7 @@ export const onReaction = (action, userDid, { id }) => {
2929
/* log('onReaction thread: ', thread) */
3030
if(action===TYPE.FAVORITE){
3131
// call favoriteSetter
32-
returndispatchEvent(EVENT.SET_FAVORITE_CONTENT,{
32+
returnsend(EVENT.SET_FAVORITE_CONTENT,{
3333
data:{ thread},
3434
})
3535
}
@@ -43,7 +43,7 @@ export const onReaction = (action, userDid, { id }) => {
4343
}
4444

4545
exportconstonListReactionUsers=(type,data)=>
46-
dispatchEvent(EVENT.USER_LISTER_OPEN,{
46+
send(EVENT.USER_LISTER_OPEN,{
4747
type,
4848
data:{ ...data,thread:store.activeThread},
4949
})

‎containers/Cashier/logic.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Global,
99
holdPage,
1010
errorForHuman,
11-
dispatchEvent,
11+
send,
1212
errRescue,
1313
}from'@utils'
1414

@@ -82,7 +82,7 @@ const DataSolver = [
8282
title:'CPS 团队感谢您的支持!',
8383
msg:'我们会尽快为您办理',
8484
})
85-
dispatchEvent(EVENT.NEW_BILLS)
85+
send(EVENT.NEW_BILLS)
8686
},
8787
},
8888
]

‎containers/Comments/logic.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
buildLog,
99
scrollIntoEle,
1010
countWords,
11-
dispatchEvent,
11+
send,
1212
extractMentions,
1313
errRescue,
1414
BStore,
@@ -225,16 +225,16 @@ export const toggleDislikeComment = comment => {
225225
}
226226

227227
exportconstonUploadImageDone=url=>
228-
dispatchEvent(EVENT.DRAFT_INSERT_SNIPPET,{data:`![](${url})`})
228+
send(EVENT.DRAFT_INSERT_SNIPPET,{data:`![](${url})`})
229229

230230
exportconstinsertQuote=()=>
231-
dispatchEvent(EVENT.DRAFT_INSERT_SNIPPET,{data:'> '})
231+
send(EVENT.DRAFT_INSERT_SNIPPET,{data:'> '})
232232

233233
exportconstinsertCode=()=>{
234234
constcommunityRaw=store.curCommunity.raw
235235
constdata=`\`\`\`${communityRaw}\n\n\`\`\``
236236

237-
dispatchEvent(EVENT.DRAFT_INSERT_SNIPPET,{ data})
237+
send(EVENT.DRAFT_INSERT_SNIPPET,{ data})
238238
}
239239

240240
exportconstonMention=user=>store.addReferUser(user)

‎containers/CommunitiesBanner/logic.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import{useEffect}from'react'
22

33
import{EVENT}from'@constant'
4-
import{asyncSuit,buildLog,dispatchEvent,updateEditing}from'@utils'
4+
import{asyncSuit,buildLog,send,updateEditing}from'@utils'
55

66
importSfrom'./schema'
77

@@ -19,7 +19,7 @@ export const loadCategories = () =>
1919

2020
exportconstsearchOnChange=e=>{
2121
updateEditing(store,'searchValue',e)
22-
dispatchEvent(EVENT.REFRESH_COMMUNITIES,{
22+
send(EVENT.REFRESH_COMMUNITIES,{
2323
type:'search',
2424
data:e.target.value,
2525
})
@@ -28,7 +28,7 @@ export const searchOnChange = e => {
2828
exportconsttabOnChange=activeTab=>{
2929
store.markRoute({subPath:activeTab})
3030
store.markState({ activeTab})
31-
dispatchEvent(EVENT.REFRESH_COMMUNITIES,{data:activeTab})
31+
send(EVENT.REFRESH_COMMUNITIES,{data:activeTab})
3232
}
3333
// ###############################
3434
// Data & Error handlers

‎containers/CommunityBanner/logic.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TYPE, EVENT, ERR } from '@constant'
55
import{
66
asyncSuit,
77
buildLog,
8-
dispatchEvent,
8+
send,
99
subPath2Thread,
1010
thread2Subpath,
1111
errRescue,
@@ -39,7 +39,7 @@ export const tabberChange = activeThread => {
3939
store.markRoute({ subPath})
4040
store.setViewing({ activeThread})
4141

42-
dispatchEvent(EVENT.TABBER_CHANGE,{data:{ activeThread,topic:subPath}})
42+
send(EVENT.TABBER_CHANGE,{data:{ activeThread,topic:subPath}})
4343
}
4444

4545
exportconstonSubscribe=community=>{
@@ -67,7 +67,7 @@ export const onShowEditorList = () => {
6767
brief:store.viewing.community.title,
6868
}
6969

70-
dispatchEvent(EVENT.USER_LISTER_OPEN,{ type, data})
70+
send(EVENT.USER_LISTER_OPEN,{ type, data})
7171
}
7272

7373
exportconstonShowSubscriberList=()=>{
@@ -77,7 +77,7 @@ export const onShowSubscriberList = () => {
7777
brief:store.viewing.community.title,
7878
}
7979

80-
dispatchEvent(EVENT.USER_LISTER_OPEN,{ type, data})
80+
send(EVENT.USER_LISTER_OPEN,{ type, data})
8181
}
8282

8383
constmarkLoading=(maybe=true)=>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp