MCPcopy Create free account
hub / github.com/cyclejs/cyclejs / create

Method create

dom/src/IsolateModule.ts:73–97  ·  view source on GitHub ↗
(oldVNode: VNode, vNode: VNode)

Source from the content-addressed store, hash-verified

71 const self = this;
72 return {
73 create(oldVNode: VNode, vNode: VNode) {
74 const {data: oldData = {}} = oldVNode;
75 const {elm, data = {}} = vNode;
76 const oldFullScope: string = (oldData as any).isolate || '';
77 const fullScope: string = (data as any).isolate || '';
78
79 // Update data structures with the newly-created element
80 if (fullScope) {
81 self.fullScopesBeingUpdated.push(fullScope);
82 if (oldFullScope) { self.elementsByFullScope.delete(oldFullScope); }
83 self.elementsByFullScope.set(fullScope, elm as Element);
84
85 // Update delegators for this scope
86 const delegators = self.delegatorsByFullScope.get(fullScope);
87 if (delegators) {
88 const len = delegators.length;
89 for (let i = 0; i < len; ++i) {
90 delegators[i].updateOrigin(elm as Element);
91 }
92 }
93 }
94 if (oldFullScope && !fullScope) {
95 self.elementsByFullScope.delete(fullScope);
96 }
97 },
98
99 update(oldVNode: VNode, vNode: VNode) {
100 const {data: oldData = {}} = oldVNode;

Callers 15

events.tsFile · 0.80
isolation.tsFile · 0.80
dom-driver.tsFile · 0.80
AppFunction · 0.80
createDestinationMethod · 0.80
fromEventFunction · 0.80
DOMDriverFunction · 0.80
setupZappingFunction · 0.80
graphSerializer.tsFile · 0.80
launcher.tsFile · 0.80
backgroundSourceDriverFunction · 0.80
startPanelFunction · 0.80

Calls 1

updateOriginMethod · 0.80

Tested by

no test coverage detected