Created
September 26, 2016 10:01
-
-
Save sorrycc/72565f379a2f773dc543fa8cbe505daf to your computer and use it in GitHub Desktop.
dva-ast-result
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"models": { | |
"list": [ | |
{ | |
"reducers": [ | |
"Reducer^^./a/c.js^^add", | |
"Reducer^^./a/c.js^^minus" | |
], | |
"effects": [ | |
"Effect^^./a/c.js^^addRemote" | |
], | |
"subscriptions": [ | |
"Subscription^^./a/c.js^^setup" | |
], | |
"namespace": "count", | |
"state": 0, | |
"id": "Model^^./a/c.js^^count", | |
"filePath": "./a/c.js" | |
} | |
], | |
"reducerByIds": { | |
"Reducer^^./a/c.js^^add": { | |
"name": "add", | |
"source": "function(state) { return state + 1; }", | |
"id": "Reducer^^./a/c.js^^add", | |
"filePath": "./a/c.js" | |
}, | |
"Reducer^^./a/c.js^^minus": { | |
"name": "minus", | |
"source": "function(state) { return state - 1; }", | |
"id": "Reducer^^./a/c.js^^minus", | |
"filePath": "./a/c.js" | |
} | |
}, | |
"effectByIds": { | |
"Effect^^./a/c.js^^addRemote": { | |
"name": "addRemote", | |
"source": "function*() { yield put({ type: 'add' }); }", | |
"dispatches": [ | |
"count/add" | |
], | |
"id": "Effect^^./a/c.js^^addRemote", | |
"filePath": "./a/c.js" | |
} | |
}, | |
"subscriptionByIds": { | |
"Subscription^^./a/c.js^^setup": { | |
"name": "setup", | |
"source": "function() {\n dispatch({ type:'app/showLoading' });\n dispatch({ type:'addRemote' });\n}", | |
"dispatches": [ | |
"app/showLoading", | |
"count/addRemote" | |
], | |
"id": "Subscription^^./a/c.js^^setup", | |
"filePath": "./a/c.js" | |
} | |
} | |
}, | |
"router": { | |
"type": "Router", | |
"attributes": { | |
"history": "history" | |
}, | |
"id": "Router-root", | |
"children": [ | |
{ | |
"type": "Route", | |
"attributes": { | |
"path": "/", | |
"component": "AppPage" | |
}, | |
"absolutePath": "/", | |
"id": "Route-/", | |
"children": [] | |
} | |
], | |
"filePath": "./a/c.js" | |
}, | |
"routeComponents": [ | |
{ | |
"name": "Component", | |
"stateMappings": [ | |
"count" | |
], | |
"dispatches": [ | |
"count/minus" | |
], | |
"filepath": "./a/c.js", | |
"id": "RouteComponent^^./a/c.js^^Component" | |
} | |
], | |
"dispatches": { | |
"count/minus": { | |
"input": [ | |
"RouteComponent^^./a/c.js^^Component" | |
], | |
"output": [ | |
"Reducer^^./a/c.js^^minus" | |
] | |
}, | |
"count/add": { | |
"input": [ | |
"Effect^^./a/c.js^^addRemote" | |
], | |
"output": [ | |
"Reducer^^./a/c.js^^add" | |
] | |
}, | |
"count/addRemote": { | |
"input": [ | |
"Subscription^^./a/c.js^^setup" | |
], | |
"output": [ | |
"Effect^^./a/c.js^^addRemote" | |
] | |
}, | |
"app/showLoading": { | |
"input": [ | |
"Subscription^^./a/c.js^^setup" | |
], | |
"output": [] | |
} | |
} | |
} |
Author
sorrycc
commented
Sep 27, 2016
routeComponents 的 source 我加下。
整理下变动点:
- dispatches 提供 input 和 output,指明输入和输出,便于关联修改
- id 规则为
类型+文件相对路径+name
,以^^
分隔 - filePath 改为相对路径
- models 结构调整,分
data
,reducersById
,effectsById
,subscriptionsById
,都放在 models 下是为了后面加入修改机制后便于修改
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment