solid-ctrl-flow 5.1.1 → 6.0.0

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
@@ -6,12 +6,6 @@ import { Owner } from 'solid-js';
6
6
  import { ParentProps } from 'solid-js';
7
7
  import { splitProps } from 'solid-js';
8
8
 
9
- /** Minimal representation of an event target */
10
- declare type AbstractEventTarget<K, F> = {
11
- addEventListener(k: K, f: F): void;
12
- removeEventListener(k: K, f: F): void;
13
- };
14
-
15
9
  /** Like a {@link Match} but gets the value from the closest {@link On} ancestor */
16
10
  export declare function Case(props: ParentProps<{
17
11
  value: unknown;
@@ -157,16 +151,6 @@ export declare class OrderedLinkedListNode<T> extends OrderedLinkedList<T> {
157
151
  remove(): void;
158
152
  }
159
153
 
160
- /**
161
- * Adds the {@link f} event listener to the {@link k} event of the {@link obj} emitter and removes it when the current reactive context is disposed
162
- * @param obj The emitter to which to add the event listener
163
- * @param k The key of the event for which to add the listener
164
- * @param f The function to call when the event is emitted
165
- */
166
- export declare function registerEventListener<K extends keyof HTMLElementEventMap>(obj: HTMLElement, type: K, listener: (this: HTMLElement, e: HTMLElementEventMap[K]) => any): void;
167
-
168
- export declare function registerEventListener<K, F>(obj: AbstractEventTarget<K, F>, k: K, f: F): void;
169
-
170
154
  /**
171
155
  * Executes {@link f} with the provided value for the specified {@link Context}.
172
156
  * You can pass `undefined` to {@link value} in order to get back the default value for {@link ctx}.
package/dist/index.mjs CHANGED
@@ -1,12 +1,8 @@
1
- import { untrack, onCleanup, createRoot, getOwner, createMemo, Show, createContext, useContext, For, createRenderEffect, on, splitProps, createSignal, createSelector, equalFn, Match, runWithOwner } from "solid-js";
1
+ import { untrack, createRoot, getOwner, createMemo, Show, createContext, useContext, onCleanup, For, createRenderEffect, on, splitProps, createSignal, createSelector, equalFn, Match, runWithOwner } from "solid-js";
2
2
  import { createComponent, memo, mergeProps, spread } from "solid-js/web";
3
3
  function untrackCall(f, ...args) {
4
4
  return untrack(() => f.apply(this, args));
5
5
  }
6
- function registerEventListener(obj, k, f) {
7
- obj.addEventListener(k, f);
8
- onCleanup(() => obj.removeEventListener(k, f));
9
- }
10
6
  function runWithContext(ctx2, value, f) {
11
7
  return createRoot((d) => {
12
8
  try {
@@ -274,7 +270,6 @@ export {
274
270
  SameContext,
275
271
  Spread,
276
272
  memoProps,
277
- registerEventListener,
278
273
  runWithContext,
279
274
  splitAndMemoProps,
280
275
  untrackCall,
package/dist/index.umd.js CHANGED
@@ -5,10 +5,6 @@
5
5
  function untrackCall(f, ...args) {
6
6
  return solidJs.untrack(() => f.apply(this, args));
7
7
  }
8
- function registerEventListener(obj, k, f) {
9
- obj.addEventListener(k, f);
10
- solidJs.onCleanup(() => obj.removeEventListener(k, f));
11
- }
12
8
  function runWithContext(ctx2, value, f) {
13
9
  return solidJs.createRoot((d) => {
14
10
  try {
@@ -275,7 +271,6 @@
275
271
  exports2.SameContext = SameContext;
276
272
  exports2.Spread = Spread;
277
273
  exports2.memoProps = memoProps;
278
- exports2.registerEventListener = registerEventListener;
279
274
  exports2.runWithContext = runWithContext;
280
275
  exports2.splitAndMemoProps = splitAndMemoProps;
281
276
  exports2.untrackCall = untrackCall;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-ctrl-flow",
3
- "version": "5.1.1",
3
+ "version": "6.0.0",
4
4
  "description": "Control flow components for solid-js",
5
5
  "author": "AFatNiBBa",
6
6
  "license": "ISC",
package/readMe.md CHANGED
@@ -233,8 +233,5 @@ Like `splitProps()` but passes the every part except the last one to [`memoProps
233
233
  ### `untrackCall()`
234
234
  Calls a function untracking what happens inside of it but not what gets passed as its argument
235
235
 
236
- ### `registerEventListener()`
237
- Adds an event listener and registers its removal
238
-
239
236
  ### `runWithContext()`
240
237
  Creates a context scope that persists for the duration of a function