MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / updateViewPlugin

Function updateViewPlugin

src/store/plugins/update-view.ts:26–41  ·  view source on GitHub ↗
(store: any)

Source from the content-addressed store, hash-verified

24
25//协同响应,更新视图
26export 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};

Callers

nothing calls this directly

Calls 2

checkMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected