(store: any)
| 24 | |
| 25 | //协同响应,更新视图 |
| 26 | export const updateViewPlugin = (store: any) => { |
| 27 | //只在渲染进程做视图的更新 |
| 28 | if (process.type != "renderer") { |
| 29 | return; |
| 30 | } |
| 31 | store.subscribe((mutation: Mutation, state: any) => { |
| 32 | const response = connections.get(mutation.type); |
| 33 | if (response != undefined) { |
| 34 | if (response.check == undefined || response.check(mutation.payload)) { |
| 35 | response.actions.forEach((e) => { |
| 36 | bus.at(e); |
| 37 | }); |
| 38 | } |
| 39 | } |
| 40 | }); |
| 41 | }; |