valyrian.js 7.2.1 → 7.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/hooks/index.ts"],"names":[],"mappings":"AAQA,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,MAAM,WAAW,cAAc;IAE7B,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IAElC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IAE/C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC;IAEhC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC;IAE/B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC;CACnC;AAED,MAAM,WAAW,UAAU;IAEzB,CAAC,cAAc,EAAE,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;CAC3D;AAED,eAAO,MAAM,UAAU,YAiFG,CAAC;AAS3B,eAAO,MAAM,QAAQ,YA7FyB,GAAG,EAAE,KAAK,GAgHtD,CAAC;AAGH,eAAO,MAAM,SAAS,YAnHwB,GAAG,EAAE,KAAK,GAuKtD,CAAC;AAEH,eAAO,MAAM,MAAM,YAzK2B,GAAG,EAAE,KAAK,GAgLtD,CAAC;AAEH,eAAO,MAAM,WAAW,YAlLsB,GAAG,EAAE,KAAK,GAgMtD,CAAC;AAEH,eAAO,MAAM,OAAO,YAlM0B,GAAG,EAAE,KAAK,GAkNtD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/hooks/index.ts"],"names":[],"mappings":"AAQA,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,MAAM,WAAW,cAAc;IAE7B,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IAElC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IAE/C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC;IAEhC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC;IAE/B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC;CACnC;AAED,MAAM,WAAW,UAAU;IAEzB,CAAC,cAAc,EAAE,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;CAC3D;AAED,eAAO,MAAM,UAAU,YAiEG,CAAC;AAS3B,eAAO,MAAM,QAAQ,YA7EyB,GAAG,EAAE,KAAK,GAgGtD,CAAC;AAGH,eAAO,MAAM,SAAS,YAnGwB,GAAG,EAAE,KAAK,GAuJtD,CAAC;AAEH,eAAO,MAAM,MAAM,YAzJ2B,GAAG,EAAE,KAAK,GAgKtD,CAAC;AAEH,eAAO,MAAM,WAAW,YAlKsB,GAAG,EAAE,KAAK,GAgLtD,CAAC;AAEH,eAAO,MAAM,OAAO,YAlL0B,GAAG,EAAE,KAAK,GAkMtD,CAAC"}
@@ -36,33 +36,31 @@ var createHook = function createHook2({
36
36
  returnValue
37
37
  }) {
38
38
  return (...args) => {
39
- let { component, vnode, oldVnode } = import_valyrian.current;
40
- if (!vnode.components) {
41
- vnode.components = [];
42
- (0, import_valyrian.onUnmount)(() => Reflect.deleteProperty(vnode, "components"));
43
- }
44
- if (vnode.components.indexOf(component) === -1) {
45
- vnode.components.push(component);
46
- }
47
- if (!component.hooks) {
48
- component.hooks = [];
49
- (0, import_valyrian.onUnmount)(() => Reflect.deleteProperty(component, "hooks"));
39
+ let { component, vnode } = import_valyrian.current;
40
+ let hook = null;
41
+ if (vnode) {
42
+ if (!vnode.components) {
43
+ vnode.components = [];
44
+ }
45
+ if (vnode.components.indexOf(component) === -1) {
46
+ vnode.hook_calls = -1;
47
+ vnode.components.push(component);
48
+ if (!component.hooks) {
49
+ component.hooks = [];
50
+ (0, import_valyrian.onUnmount)(() => Reflect.deleteProperty(component, "hooks"));
51
+ }
52
+ }
53
+ hook = component.hooks[++vnode.hook_calls];
50
54
  }
51
- let hook = void 0;
52
- if (!oldVnode || !oldVnode.components || oldVnode.components[vnode.components.length - 1] !== component) {
55
+ if (!hook) {
53
56
  hook = onCreate(...args);
54
- component.hooks.push(hook);
57
+ if (vnode) {
58
+ component.hooks.push(hook);
59
+ }
55
60
  if (onRemove) {
56
61
  (0, import_valyrian.onUnmount)(() => onRemove(hook));
57
62
  }
58
63
  } else {
59
- if ("calls" in component === false) {
60
- component.calls = -1;
61
- (0, import_valyrian.onUnmount)(() => Reflect.deleteProperty(component, "calls"));
62
- }
63
- (0, import_valyrian.onCleanup)(() => component.calls = -1);
64
- component.calls++;
65
- hook = component.hooks[component.calls];
66
64
  if (onUpdateHook) {
67
65
  onUpdateHook(hook, ...args);
68
66
  }
@@ -83,18 +81,20 @@ function delayedUpdate() {
83
81
  }
84
82
  var useState = createHook({
85
83
  onCreate: (value) => {
86
- let stateObj = /* @__PURE__ */ Object.create(null);
87
- stateObj.value = value;
88
- stateObj.toJSON = stateObj.toString = stateObj.valueOf = () => typeof stateObj.value === "function" ? stateObj.value() : stateObj.value;
89
- return [
90
- stateObj,
91
- (value2) => {
92
- if (stateObj.value !== value2) {
93
- stateObj.value = value2;
94
- delayedUpdate();
95
- }
84
+ function get() {
85
+ return value;
86
+ }
87
+ get.value = value;
88
+ get.toJSON = get.valueOf = get;
89
+ get.toString = () => `${value}`;
90
+ function set(newValue) {
91
+ if (value !== newValue) {
92
+ value = newValue;
93
+ get.value = newValue;
94
+ delayedUpdate();
96
95
  }
97
- ];
96
+ }
97
+ return [get, set];
98
98
  }
99
99
  });
100
100
  var useEffect = createHook({
@@ -8,33 +8,31 @@ var createHook = function createHook2({
8
8
  returnValue
9
9
  }) {
10
10
  return (...args) => {
11
- let { component, vnode, oldVnode } = current;
12
- if (!vnode.components) {
13
- vnode.components = [];
14
- onUnmount(() => Reflect.deleteProperty(vnode, "components"));
15
- }
16
- if (vnode.components.indexOf(component) === -1) {
17
- vnode.components.push(component);
18
- }
19
- if (!component.hooks) {
20
- component.hooks = [];
21
- onUnmount(() => Reflect.deleteProperty(component, "hooks"));
11
+ let { component, vnode } = current;
12
+ let hook = null;
13
+ if (vnode) {
14
+ if (!vnode.components) {
15
+ vnode.components = [];
16
+ }
17
+ if (vnode.components.indexOf(component) === -1) {
18
+ vnode.hook_calls = -1;
19
+ vnode.components.push(component);
20
+ if (!component.hooks) {
21
+ component.hooks = [];
22
+ onUnmount(() => Reflect.deleteProperty(component, "hooks"));
23
+ }
24
+ }
25
+ hook = component.hooks[++vnode.hook_calls];
22
26
  }
23
- let hook = void 0;
24
- if (!oldVnode || !oldVnode.components || oldVnode.components[vnode.components.length - 1] !== component) {
27
+ if (!hook) {
25
28
  hook = onCreate(...args);
26
- component.hooks.push(hook);
29
+ if (vnode) {
30
+ component.hooks.push(hook);
31
+ }
27
32
  if (onRemove) {
28
33
  onUnmount(() => onRemove(hook));
29
34
  }
30
35
  } else {
31
- if ("calls" in component === false) {
32
- component.calls = -1;
33
- onUnmount(() => Reflect.deleteProperty(component, "calls"));
34
- }
35
- onCleanup(() => component.calls = -1);
36
- component.calls++;
37
- hook = component.hooks[component.calls];
38
36
  if (onUpdateHook) {
39
37
  onUpdateHook(hook, ...args);
40
38
  }
@@ -55,18 +53,20 @@ function delayedUpdate() {
55
53
  }
56
54
  var useState = createHook({
57
55
  onCreate: (value) => {
58
- let stateObj = /* @__PURE__ */ Object.create(null);
59
- stateObj.value = value;
60
- stateObj.toJSON = stateObj.toString = stateObj.valueOf = () => typeof stateObj.value === "function" ? stateObj.value() : stateObj.value;
61
- return [
62
- stateObj,
63
- (value2) => {
64
- if (stateObj.value !== value2) {
65
- stateObj.value = value2;
66
- delayedUpdate();
67
- }
56
+ function get() {
57
+ return value;
58
+ }
59
+ get.value = value;
60
+ get.toJSON = get.valueOf = get;
61
+ get.toString = () => `${value}`;
62
+ function set(newValue) {
63
+ if (value !== newValue) {
64
+ value = newValue;
65
+ get.value = newValue;
66
+ delayedUpdate();
68
67
  }
69
- ];
68
+ }
69
+ return [get, set];
70
70
  }
71
71
  });
72
72
  var useEffect = createHook({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/signal/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,YAAY,KAAA,OAmGlC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/signal/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,YAAY,KAAA,OA+GlC"}
@@ -24,15 +24,22 @@ __export(signal_exports, {
24
24
  module.exports = __toCommonJS(signal_exports);
25
25
  var import_valyrian = require("valyrian.js");
26
26
  function Signal(initialValue) {
27
- const context = { ...import_valyrian.current };
28
- if (context.vnode) {
29
- if (!context.vnode.signals) {
30
- context.vnode.signals = context.oldVnode?.signals || [];
31
- context.vnode.calls = -1;
32
- context.vnode.subscribers = context.oldVnode?.subscribers || [];
33
- context.vnode.initialChildren = [...context.vnode.children];
27
+ const { vnode, oldVnode, component } = { ...import_valyrian.current };
28
+ if (vnode) {
29
+ if (!vnode.components) {
30
+ vnode.components = [];
34
31
  }
35
- let signal2 = context.vnode.signals[++context.vnode.calls];
32
+ if (vnode.components.indexOf(component) === -1) {
33
+ vnode.subscribers = oldVnode?.subscribers || [];
34
+ vnode.initialChildren = [...vnode.children];
35
+ vnode.signal_calls = -1;
36
+ vnode.components.push(component);
37
+ if (!component.signals) {
38
+ component.signals = [];
39
+ (0, import_valyrian.onUnmount)(() => Reflect.deleteProperty(component, "signals"));
40
+ }
41
+ }
42
+ let signal2 = component.signals[++vnode.signal_calls];
36
43
  if (signal2) {
37
44
  return signal2;
38
45
  }
@@ -56,22 +63,22 @@ function Signal(initialValue) {
56
63
  for (let i = 0, l = subscribers.length; i < l; i++) {
57
64
  subscribers[i](value);
58
65
  }
59
- if (context.vnode) {
60
- let newVnode = (0, import_valyrian.v)(context.vnode.tag, context.vnode.props, ...context.vnode.initialChildren);
61
- newVnode.dom = context.vnode.dom;
62
- newVnode.isSVG = context.vnode.isSVG;
63
- context.vnode.subscribers.forEach(
66
+ if (vnode) {
67
+ let newVnode = (0, import_valyrian.v)(vnode.tag, vnode.props, ...vnode.initialChildren);
68
+ newVnode.dom = vnode.dom;
69
+ newVnode.isSVG = vnode.isSVG;
70
+ vnode.subscribers.forEach(
64
71
  (subscribers2) => subscribers2.length = 0
65
72
  );
66
- context.vnode.subscribers = [];
67
- return (0, import_valyrian.updateVnode)(newVnode, context.vnode);
73
+ vnode.subscribers = [];
74
+ return (0, import_valyrian.updateVnode)(newVnode, vnode);
68
75
  }
69
76
  return (0, import_valyrian.update)();
70
77
  };
71
78
  let signal = [get, set, subscribe];
72
- if (context.vnode) {
73
- context.vnode.signals.push(signal);
74
- context.vnode.subscribers.push(subscribers);
79
+ if (vnode) {
80
+ component.signals.push(signal);
81
+ vnode.subscribers.push(subscribers);
75
82
  }
76
83
  return signal;
77
84
  }
@@ -1,15 +1,22 @@
1
1
  // lib/signal/index.ts
2
- import { current, update, updateVnode, v } from "valyrian.js";
2
+ import { current, onUnmount, update, updateVnode, v } from "valyrian.js";
3
3
  function Signal(initialValue) {
4
- const context = { ...current };
5
- if (context.vnode) {
6
- if (!context.vnode.signals) {
7
- context.vnode.signals = context.oldVnode?.signals || [];
8
- context.vnode.calls = -1;
9
- context.vnode.subscribers = context.oldVnode?.subscribers || [];
10
- context.vnode.initialChildren = [...context.vnode.children];
4
+ const { vnode, oldVnode, component } = { ...current };
5
+ if (vnode) {
6
+ if (!vnode.components) {
7
+ vnode.components = [];
11
8
  }
12
- let signal2 = context.vnode.signals[++context.vnode.calls];
9
+ if (vnode.components.indexOf(component) === -1) {
10
+ vnode.subscribers = oldVnode?.subscribers || [];
11
+ vnode.initialChildren = [...vnode.children];
12
+ vnode.signal_calls = -1;
13
+ vnode.components.push(component);
14
+ if (!component.signals) {
15
+ component.signals = [];
16
+ onUnmount(() => Reflect.deleteProperty(component, "signals"));
17
+ }
18
+ }
19
+ let signal2 = component.signals[++vnode.signal_calls];
13
20
  if (signal2) {
14
21
  return signal2;
15
22
  }
@@ -33,22 +40,22 @@ function Signal(initialValue) {
33
40
  for (let i = 0, l = subscribers.length; i < l; i++) {
34
41
  subscribers[i](value);
35
42
  }
36
- if (context.vnode) {
37
- let newVnode = v(context.vnode.tag, context.vnode.props, ...context.vnode.initialChildren);
38
- newVnode.dom = context.vnode.dom;
39
- newVnode.isSVG = context.vnode.isSVG;
40
- context.vnode.subscribers.forEach(
43
+ if (vnode) {
44
+ let newVnode = v(vnode.tag, vnode.props, ...vnode.initialChildren);
45
+ newVnode.dom = vnode.dom;
46
+ newVnode.isSVG = vnode.isSVG;
47
+ vnode.subscribers.forEach(
41
48
  (subscribers2) => subscribers2.length = 0
42
49
  );
43
- context.vnode.subscribers = [];
44
- return updateVnode(newVnode, context.vnode);
50
+ vnode.subscribers = [];
51
+ return updateVnode(newVnode, vnode);
45
52
  }
46
53
  return update();
47
54
  };
48
55
  let signal = [get, set, subscribe];
49
- if (context.vnode) {
50
- context.vnode.signals.push(signal);
51
- context.vnode.subscribers.push(subscribers);
56
+ if (vnode) {
57
+ component.signals.push(signal);
58
+ vnode.subscribers.push(subscribers);
52
59
  }
53
60
  return signal;
54
61
  }
@@ -34,35 +34,37 @@ export const createHook = function createHook({
34
34
  returnValue
35
35
  }: HookDefinition): Hook {
36
36
  return (...args: any[]) => {
37
- let { component, vnode, oldVnode } = current as CurrentOnPatch;
37
+ let { component, vnode } = current as CurrentOnPatch;
38
38
 
39
- // Init the components array for the current vnode
40
- if (!vnode.components) {
41
- vnode.components = [];
42
- onUnmount(() => Reflect.deleteProperty(vnode, "components"));
43
- }
39
+ let hook = null;
44
40
 
45
- // Add the component to the components array if it's not already there
46
- if (vnode.components.indexOf(component) === -1) {
47
- vnode.components.push(component);
48
- }
41
+ if (vnode) {
42
+ // Init the components array for the current vnode
43
+ if (!vnode.components) {
44
+ vnode.components = [];
45
+ }
49
46
 
50
- // Init the component hooks array
51
- if (!component.hooks) {
52
- component.hooks = [];
53
- onUnmount(() => Reflect.deleteProperty(component, "hooks"));
54
- }
47
+ if (vnode.components.indexOf(component) === -1) {
48
+ vnode.hook_calls = -1;
49
+ vnode.components.push(component);
50
+ if (!component.hooks) {
51
+ component.hooks = [];
52
+ onUnmount(() => Reflect.deleteProperty(component, "hooks"));
53
+ }
54
+ }
55
55
 
56
- let hook: Hook = undefined;
56
+ hook = component.hooks[++vnode.hook_calls];
57
+ }
57
58
 
58
- // if no old vnode or old vnode has no components or old vnode's last component is not the current component
59
- // we are mounting the component for the first time so we create a new hook
60
- if (!oldVnode || !oldVnode.components || oldVnode.components[vnode.components.length - 1] !== component) {
59
+ // If the hook doesn't exist, create it
60
+ if (!hook) {
61
61
  // create a new hook
62
62
  hook = onCreate(...args);
63
63
 
64
- // add the hook to the component's hooks array
65
- component.hooks.push(hook);
64
+ if (vnode) {
65
+ // Add the hook to the component
66
+ component.hooks.push(hook);
67
+ }
66
68
 
67
69
  // if we have a onRemove hook, add it to the onUnmount set
68
70
  if (onRemove) {
@@ -70,24 +72,6 @@ export const createHook = function createHook({
70
72
  onUnmount(() => onRemove(hook));
71
73
  }
72
74
  } else {
73
- // old vnode has components, we are updating the component
74
-
75
- // Set the calls property to the current component if it's not already set
76
- if ("calls" in component === false) {
77
- component.calls = -1;
78
- onUnmount(() => Reflect.deleteProperty(component, "calls"));
79
- }
80
-
81
- // Reset the calls property to -1 on cleanup so we can detect if the component is updated again
82
- onCleanup(() => (component.calls = -1));
83
-
84
- // Increment the calls property
85
- component.calls++;
86
-
87
- // Get the current hook from the component's hooks array
88
- hook = component.hooks[component.calls];
89
-
90
- // If we have an onUpdate hook, call it
91
75
  if (onUpdateHook) {
92
76
  onUpdateHook(hook, ...args);
93
77
  }
@@ -118,22 +102,22 @@ function delayedUpdate() {
118
102
  // Use state hook
119
103
  export const useState = createHook({
120
104
  onCreate: (value) => {
121
- let stateObj = Object.create(null);
122
- stateObj.value = value;
123
- stateObj.toJSON =
124
- stateObj.toString =
125
- stateObj.valueOf =
126
- () => (typeof stateObj.value === "function" ? stateObj.value() : stateObj.value);
127
-
128
- return [
129
- stateObj,
130
- (value: any) => {
131
- if (stateObj.value !== value) {
132
- stateObj.value = value;
133
- delayedUpdate();
134
- }
105
+ function get() {
106
+ return value;
107
+ }
108
+ get.value = value;
109
+ get.toJSON = get.valueOf = get;
110
+ get.toString = () => `${value}`;
111
+
112
+ function set(newValue) {
113
+ if (value !== newValue) {
114
+ value = newValue;
115
+ get.value = newValue;
116
+ delayedUpdate();
135
117
  }
136
- ];
118
+ }
119
+
120
+ return [get, set];
137
121
  }
138
122
  });
139
123
 
@@ -1,26 +1,38 @@
1
- import { VnodeWithDom, current, update, updateVnode, v } from "valyrian.js";
1
+ import { VnodeWithDom, current, onUnmount, update, updateVnode, v } from "valyrian.js";
2
2
 
3
3
  export function Signal(initialValue) {
4
4
  // Create a copy of the current context object
5
- const context = { ...current };
5
+ const { vnode, oldVnode, component } = { ...current };
6
6
 
7
7
  // Check if the context object has a vnode property
8
- if (context.vnode) {
8
+ if (vnode) {
9
9
  // Is first call
10
- if (!context.vnode.signals) {
11
- // Set the signals property to the signals property of the oldVnode object, or an empty array if that doesn't exist
12
- context.vnode.signals = context.oldVnode?.signals || [];
13
- // Set the calls property to -1
14
- context.vnode.calls = -1;
15
- // Set the subscribers property to the subscribers property of the oldVnode object, or an empty array if that doesn't exist
16
- context.vnode.subscribers = context.oldVnode?.subscribers || [];
10
+ if (!vnode.components) {
11
+ // Set the components property to an empty array
12
+ vnode.components = [];
13
+ }
17
14
 
15
+ if (vnode.components.indexOf(component) === -1) {
16
+ // Set the subscribers property to the subscribers property of the oldVnode object, or an empty array if that doesn't exist
17
+ vnode.subscribers = oldVnode?.subscribers || [];
18
18
  // Set the initialChildren property of the vnode object to a copy of the children array of the vnode object
19
- context.vnode.initialChildren = [...context.vnode.children];
19
+ vnode.initialChildren = [...vnode.children];
20
+
21
+ // Set the calls property to -1
22
+ vnode.signal_calls = -1;
23
+ // Add the component to the components array
24
+ vnode.components.push(component);
25
+
26
+ if (!component.signals) {
27
+ // Set the signals property of the component object to an empty array
28
+ component.signals = [];
29
+ // Add a function to the cleanup stack that removes the signals property from the component object
30
+ onUnmount(() => Reflect.deleteProperty(component, "signals"));
31
+ }
20
32
  }
21
33
 
22
34
  // Assign the signal variable to the signal stored at the index of the vnode object's calls property in the vnode's signals array
23
- let signal = context.vnode.signals[++context.vnode.calls];
35
+ let signal = component.signals[++vnode.signal_calls];
24
36
 
25
37
  // If a signal has already been assigned to the signal variable, return it
26
38
  if (signal) {
@@ -63,24 +75,24 @@ export function Signal(initialValue) {
63
75
  }
64
76
 
65
77
  // Check if the context object has a vnode property
66
- if (context.vnode) {
78
+ if (vnode) {
67
79
  // If it does, create a new vnode object based on the original vnode, its children, and its DOM and SVG properties
68
- let newVnode = v(context.vnode.tag, context.vnode.props, ...context.vnode.initialChildren) as VnodeWithDom;
69
- newVnode.dom = context.vnode.dom;
70
- newVnode.isSVG = context.vnode.isSVG;
80
+ let newVnode = v(vnode.tag, vnode.props, ...vnode.initialChildren) as VnodeWithDom;
81
+ newVnode.dom = vnode.dom;
82
+ newVnode.isSVG = vnode.isSVG;
71
83
 
72
84
  // Clear the subscribers array by setting the length property to 0
73
- context.vnode.subscribers.forEach(
85
+ vnode.subscribers.forEach(
74
86
  (subscribers) =>
75
87
  // Setting the length property to 0 is faster than clearing the array with a loop
76
88
  (subscribers.length = 0)
77
89
  );
78
90
 
79
91
  // Clear the subscribers array by setting it to an empty array
80
- context.vnode.subscribers = [];
92
+ vnode.subscribers = [];
81
93
 
82
94
  // Return the result of updating the original vnode with the new vnode
83
- return updateVnode(newVnode, context.vnode);
95
+ return updateVnode(newVnode, vnode);
84
96
  }
85
97
 
86
98
  // If the context object doesn't have a vnode property, return the result of calling the update function
@@ -92,9 +104,9 @@ export function Signal(initialValue) {
92
104
 
93
105
  // If the context object has a vnode property, add the signal to the vnode's signals array
94
106
  // and add the subscribers array to the vnode's subscribers array
95
- if (context.vnode) {
96
- context.vnode.signals.push(signal);
97
- context.vnode.subscribers.push(subscribers);
107
+ if (vnode) {
108
+ component.signals.push(signal);
109
+ vnode.subscribers.push(subscribers);
98
110
  }
99
111
 
100
112
  // Return the signal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valyrian.js",
3
- "version": "7.2.1",
3
+ "version": "7.2.2",
4
4
  "description": "Lightweight steel to forge PWAs. (Minimal Frontend Framework with server side rendering and other capabilities)",
5
5
  "repository": "git@github.com:Masquerade-Circus/valyrian.js.git",
6
6
  "author": "Masquerade <christian@masquerade-circus.net>",