cradova 3.7.9 → 3.7.11

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.
package/dist/index.js CHANGED
@@ -207,6 +207,15 @@ var toFunc = (func) => {
207
207
  func.pipes = new Map;
208
208
  return funcManager.render(func);
209
209
  };
210
+ var toFuncNoRender = (func) => {
211
+ if (typeof func._state_index === "number")
212
+ return func;
213
+ Object.assign(func, DEFAULT_STATE);
214
+ func._state = [];
215
+ func.signals = new Map;
216
+ func.pipes = new Map;
217
+ return func;
218
+ };
210
219
  var funcManager = {
211
220
  render(func) {
212
221
  Object.assign(func, DEFAULT_STATE);
@@ -402,6 +411,12 @@ class Signal {
402
411
  });
403
412
  return;
404
413
  }
414
+ if (!isArrowFunc(comp) && !comp.signals) {
415
+ comp = toFuncNoRender(comp);
416
+ } else {
417
+ console.error(` ✘ Cradova err: ${String(comp)} is not a valid component or function`);
418
+ return;
419
+ }
405
420
  if (comp.signals.get(eventName))
406
421
  return;
407
422
  if (eventName in this.pipe) {
@@ -723,6 +738,7 @@ export {
723
738
  useEffect,
724
739
  ul,
725
740
  tr,
741
+ toFuncNoRender,
726
742
  textarea,
727
743
  td,
728
744
  tbody,
@@ -741,6 +757,7 @@ export {
741
757
  loop,
742
758
  li,
743
759
  label,
760
+ isArrowFunc,
744
761
  input,
745
762
  img,
746
763
  iframe,
@@ -60,6 +60,8 @@ Returns a mutable reference object of dom elements.
60
60
  */
61
61
  export declare function useRef(): __raw_ref;
62
62
  export declare const getSignal: (name: string, func: Func) => any;
63
+ export declare const isArrowFunc: (fn: Function) => boolean;
64
+ export declare const toFuncNoRender: (func: any) => any;
63
65
  export declare const funcManager: {
64
66
  render(func: Func): HTMLElement;
65
67
  recall(func: Func): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cradova",
3
- "version": "3.7.9",
3
+ "version": "3.7.11",
4
4
  "description": "Build Powerful ⚡ Web Apps with Ease",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",