solid-ctrl-flow 1.0.10 → 1.0.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.d.ts CHANGED
@@ -117,6 +117,16 @@ export declare function runWithContext<T, R>(ctx: Context<T>, value: T, f: (x: T
117
117
  */
118
118
  export declare function splitAndMemoProps<T extends object, K extends readonly (keyof T)[]>(obj: T, keys: K): readonly [Pick<Pick<T, Extract<K, readonly (keyof T)[]>[number]>, K[number]>, Omit<T, K[number]>];
119
119
 
120
+ /**
121
+ * Executes {@link f} untracking it.
122
+ * Due to the fact that the function is passed as input, it does not untrack its changes (It's intentional)
123
+ * @param this The same thing that {@link f} wants as `this`
124
+ * @param f The function to call
125
+ * @param args Arguments for calling {@link f}
126
+ * @returns The same thing {@link f} returned
127
+ */
128
+ export declare function untrackCall<F extends (...args: any[]) => any>(this: ThisParameterType<F>, f: F, ...args: Parameters<F>): any;
129
+
120
130
  /** Like a {@link Match} but gets the value from the closest {@link Case} ancestor */
121
131
  export declare function When(props: {
122
132
  value: unknown;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createContext, createMemo, createComponent, useContext, Match, mergeProps, onCleanup, For, Show, splitProps, createRoot, getOwner } from "solid-js";
1
+ import { createContext, createMemo, createComponent, useContext, Match, mergeProps, onCleanup, For, Show, splitProps, createRoot, getOwner, untrack } from "solid-js";
2
2
  import { createMutable } from "solid-js/store";
3
3
  const ctx$1 = createContext(() => void 0, {
4
4
  name: "case-when"
@@ -134,6 +134,9 @@ function runWithContext(ctx2, value, f) {
134
134
  }
135
135
  });
136
136
  }
137
+ function untrackCall(f, ...args) {
138
+ return untrack(() => f.apply(this, args));
139
+ }
137
140
  export {
138
141
  Case,
139
142
  Debug,
@@ -141,5 +144,6 @@ export {
141
144
  createExtractor,
142
145
  memoProps,
143
146
  runWithContext,
144
- splitAndMemoProps
147
+ splitAndMemoProps,
148
+ untrackCall
145
149
  };
package/dist/index.umd.js CHANGED
@@ -136,6 +136,9 @@
136
136
  }
137
137
  });
138
138
  }
139
+ function untrackCall(f, ...args) {
140
+ return solidJs.untrack(() => f.apply(this, args));
141
+ }
139
142
  exports2.Case = Case;
140
143
  exports2.Debug = Debug;
141
144
  exports2.When = When;
@@ -143,5 +146,6 @@
143
146
  exports2.memoProps = memoProps;
144
147
  exports2.runWithContext = runWithContext;
145
148
  exports2.splitAndMemoProps = splitAndMemoProps;
149
+ exports2.untrackCall = untrackCall;
146
150
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
147
151
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-ctrl-flow",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Control flow components for solid-js",
5
5
  "author": "AFatNiBBa",
6
6
  "license": "ISC",