@ersbeth/picoflow 2.0.0 → 2.0.1
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/picoflow.js +322 -314
- package/dist/types/api/base/flowSubscribable.d.ts +1 -1
- package/dist/types/api/base/flowSubscribable.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowDerivationAsync.d.ts +1 -1
- package/dist/types/api/nodes/async/flowDerivationAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/flowEffect.d.ts +2 -1
- package/dist/types/api/nodes/flowEffect.d.ts.map +1 -1
- package/dist/types/api/nodes/flowSignal.d.ts +1 -1
- package/dist/types/api/nodes/flowSignal.d.ts.map +1 -1
- package/dist/types/api/nodes/flowValue.d.ts +2 -1
- package/dist/types/api/nodes/flowValue.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowDerivation.d.ts +1 -1
- package/dist/types/api/nodes/sync/flowDerivation.d.ts.map +1 -1
- package/dist/types/api/nodes/utils.d.ts +2 -1
- package/dist/types/api/nodes/utils.d.ts.map +1 -1
- package/dist/types/base/disposable.d.ts +1 -1
- package/dist/types/base/disposable.d.ts.map +1 -1
- package/dist/types/base/node.d.ts +1 -1
- package/dist/types/base/node.d.ts.map +1 -1
- package/dist/types/base/observable.d.ts +1 -3
- package/dist/types/base/observable.d.ts.map +1 -1
- package/dist/types/converters/solid.d.ts +1 -1
- package/dist/types/converters/solid.d.ts.map +1 -1
- package/dist/types/nodes/arrayNode.d.ts +24 -1
- package/dist/types/nodes/arrayNode.d.ts.map +1 -1
- package/dist/types/nodes/effectNode.d.ts +15 -1
- package/dist/types/nodes/effectNode.d.ts.map +1 -1
- package/dist/types/nodes/index.d.ts +0 -1
- package/dist/types/nodes/index.d.ts.map +1 -1
- package/dist/types/nodes/mapNode.d.ts +18 -1
- package/dist/types/nodes/mapNode.d.ts.map +1 -1
- package/dist/types/nodes/signalNode.d.ts +9 -1
- package/dist/types/nodes/signalNode.d.ts.map +1 -1
- package/dist/types/nodes/valueAsyncNode.d.ts +22 -1
- package/dist/types/nodes/valueAsyncNode.d.ts.map +1 -1
- package/dist/types/nodes/valueNode.d.ts +19 -1
- package/dist/types/nodes/valueNode.d.ts.map +1 -1
- package/dist/types/nodes/valueSyncNode.d.ts +22 -1
- package/dist/types/nodes/valueSyncNode.d.ts.map +1 -1
- package/dist/types/schedulers/asyncResolver.d.ts +18 -1
- package/dist/types/schedulers/asyncResolver.d.ts.map +1 -1
- package/dist/types/schedulers/asyncScheduler.d.ts +19 -1
- package/dist/types/schedulers/asyncScheduler.d.ts.map +1 -1
- package/dist/types/schedulers/pendingError.d.ts +8 -1
- package/dist/types/schedulers/pendingError.d.ts.map +1 -1
- package/dist/types/schedulers/scheduler.d.ts +9 -1
- package/dist/types/schedulers/scheduler.d.ts.map +1 -1
- package/dist/types/schedulers/syncResolver.d.ts +18 -1
- package/dist/types/schedulers/syncResolver.d.ts.map +1 -1
- package/dist/types/schedulers/syncScheduler.d.ts +18 -1
- package/dist/types/schedulers/syncScheduler.d.ts.map +1 -1
- package/docs/api/typedoc-sidebar.json +65 -1
- package/package.json +1 -1
- package/src/api/base/flowSubscribable.ts +1 -1
- package/src/api/nodes/async/flowConstantAsync.ts +1 -1
- package/src/api/nodes/async/flowDerivationAsync.ts +2 -2
- package/src/api/nodes/async/flowStateAsync.ts +1 -1
- package/src/api/nodes/async/flowWritableDerivationAsync.ts +1 -1
- package/src/api/nodes/collections/flowArray.ts +1 -1
- package/src/api/nodes/collections/flowMap.ts +1 -1
- package/src/api/nodes/flowEffect.ts +3 -3
- package/src/api/nodes/flowSignal.ts +2 -2
- package/src/api/nodes/flowValue.ts +2 -1
- package/src/api/nodes/sync/flowConstant.ts +1 -1
- package/src/api/nodes/sync/flowDerivation.ts +2 -2
- package/src/api/nodes/sync/flowState.ts +1 -1
- package/src/api/nodes/sync/flowWritableDerivation.ts +1 -1
- package/src/api/nodes/utils.ts +3 -1
- package/src/base/disposable.ts +1 -1
- package/src/base/node.ts +1 -1
- package/src/base/observable.ts +8 -3
- package/src/converters/solid.ts +2 -2
- package/src/nodes/arrayNode.ts +12 -4
- package/src/nodes/effectNode.ts +4 -5
- package/src/nodes/index.ts +0 -1
- package/src/nodes/mapNode.ts +2 -4
- package/src/nodes/signalNode.ts +2 -4
- package/src/nodes/valueAsyncNode.ts +2 -5
- package/src/nodes/valueNode.ts +10 -6
- package/src/nodes/valueSyncNode.ts +2 -5
- package/test/base/pendingError.test.ts +1 -1
- package/tsconfig.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ValueAsyncNode } from "../../../nodes/valueAsyncNode";
|
|
2
|
+
import type { FlowTracker } from "../../base";
|
|
3
3
|
import type { FlowValue } from "../flowValue";
|
|
4
4
|
import type { NotPromise } from "../utils";
|
|
5
5
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { EffectNode } from "../../nodes/effectNode";
|
|
2
|
+
import type { FlowDisposable } from "../base/flowDisposable";
|
|
1
3
|
import type {
|
|
2
4
|
FlowDataTracker,
|
|
3
|
-
FlowDisposable,
|
|
4
5
|
FlowOnDataListener,
|
|
5
6
|
FlowOnErrorListener,
|
|
6
7
|
FlowOnPendingListener,
|
|
7
|
-
} from "
|
|
8
|
-
import { EffectNode } from "~/nodes";
|
|
8
|
+
} from "../base/flowSubscribable";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Handle to a reactive effect that automatically tracks dependencies and re-executes when they change.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { SignalNode } from "../../nodes/signalNode";
|
|
2
|
+
import type { FlowObservable } from "../base/flowObservable";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Manual trigger that notifies subscribers without carrying data.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { FlowObservable
|
|
1
|
+
import type { FlowObservable } from "../base/flowObservable";
|
|
2
|
+
import type { FlowTracker } from "../base/flowTracker";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Base interface for reactive values that can be read synchronously or asynchronously.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ValueSyncNode } from "
|
|
2
|
-
import type { FlowTracker } from "../../base";
|
|
1
|
+
import { ValueSyncNode } from "../../../nodes/valueSyncNode";
|
|
2
|
+
import type { FlowTracker } from "../../base/flowTracker";
|
|
3
3
|
import type { FlowValue } from "../flowValue";
|
|
4
4
|
import type { NotPromise } from "../utils";
|
|
5
5
|
|
package/src/api/nodes/utils.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { FlowValue } from "./flowValue";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Type that excludes Promise values from a type union.
|
|
3
5
|
*
|
|
@@ -19,4 +21,4 @@ export type NotPromise<T> = T extends Promise<unknown> ? never : T;
|
|
|
19
21
|
*
|
|
20
22
|
* @public
|
|
21
23
|
*/
|
|
22
|
-
export type FlowReadonly<T> = Omit<T
|
|
24
|
+
export type FlowReadonly<T> = Omit<FlowValue<T>, "set" | "refresh" | "trigger">;
|
package/src/base/disposable.ts
CHANGED
package/src/base/node.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowTracker } from "
|
|
1
|
+
import type { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowTracker } from "../api";
|
|
2
2
|
import { Disposable } from "./disposable";
|
|
3
3
|
import type { IObservable, ObservableStatus } from "./observable";
|
|
4
4
|
import type { IObserver } from "./observer";
|
package/src/base/observable.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
FlowEffect,
|
|
3
|
+
FlowObservable,
|
|
4
|
+
FlowOnDataListener,
|
|
5
|
+
FlowOnErrorListener,
|
|
6
|
+
FlowOnPendingListener,
|
|
7
|
+
FlowTracker,
|
|
8
|
+
} from "../api";
|
|
4
9
|
import { Disposable } from "./disposable";
|
|
5
10
|
import type { IObserver } from "./observer";
|
|
6
11
|
|
package/src/converters/solid.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createEffect, createResource, onCleanup, onMount, type Resource, resetErrorBoundaries } from "solid-js";
|
|
2
|
-
import { type FlowEffect, type FlowObservable, type FlowTracker, type NotPromise, subscribe } from "
|
|
3
|
-
import { ValueAsyncNode, ValueSyncNode } from "
|
|
2
|
+
import { type FlowEffect, type FlowObservable, type FlowTracker, type NotPromise, subscribe } from "../api";
|
|
3
|
+
import { ValueAsyncNode, ValueSyncNode } from "../nodes";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal helper that converts a PicoFlow node into a SolidJS resource.
|
package/src/nodes/arrayNode.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { FlowArray, FlowArrayAction } from "
|
|
2
|
-
import
|
|
3
|
-
import type { NotPromise } from "~/api/nodes/utils";
|
|
4
|
-
import { Disposable } from "~/base";
|
|
1
|
+
import type { FlowArray, FlowArrayAction, FlowTracker, NotPromise, UpdateFunction } from "../api";
|
|
2
|
+
import { Disposable } from "../base";
|
|
5
3
|
import { ValueSyncNode } from "./valueSyncNode";
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -21,6 +19,16 @@ export class ArrayNode<T> extends ValueSyncNode<T[]> implements FlowArray<T> {
|
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
|
|
22
|
+
override get(tracker: FlowTracker): T[] {
|
|
23
|
+
const values = super.get(tracker);
|
|
24
|
+
return [...values];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
override async pick(): Promise<T[]> {
|
|
28
|
+
const values = await super.pick();
|
|
29
|
+
return [...values];
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
get length(): number {
|
|
25
33
|
if (this.disposed) throw new Error("[PicoFlow] Primitive is disposed");
|
|
26
34
|
return this._value.length;
|
package/src/nodes/effectNode.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
FlowDataTracker,
|
|
3
|
+
FlowEffect,
|
|
3
4
|
FlowOnDataListener,
|
|
4
5
|
FlowOnErrorListener,
|
|
5
6
|
FlowOnPendingListener,
|
|
6
|
-
} from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { Observer } from "~/base/";
|
|
10
|
-
import { PendingError } from "~/schedulers";
|
|
7
|
+
} from "../api";
|
|
8
|
+
import { ExecutionStack, Observer } from "../base";
|
|
9
|
+
import { PendingError } from "../schedulers";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Reactive effect that automatically re-executes when its dependencies change.
|
package/src/nodes/index.ts
CHANGED
package/src/nodes/mapNode.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { FlowMap, FlowMapAction } from "
|
|
2
|
-
import
|
|
3
|
-
import type { NotPromise } from "~/api/nodes/utils";
|
|
4
|
-
import { Disposable } from "~/base";
|
|
1
|
+
import type { FlowMap, FlowMapAction, NotPromise, UpdateFunction } from "../api";
|
|
2
|
+
import { Disposable } from "../base";
|
|
5
3
|
import { ValueSyncNode } from "./valueSyncNode";
|
|
6
4
|
|
|
7
5
|
/**
|
package/src/nodes/signalNode.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { FlowEffect } from "
|
|
2
|
-
import
|
|
3
|
-
import type { FlowSignal } from "~/api/nodes/flowSignal";
|
|
4
|
-
import { Observable, type Observer } from "~/base/";
|
|
1
|
+
import type { FlowEffect, FlowOnDataListener, FlowOnErrorListener, FlowOnPendingListener, FlowSignal } from "../api";
|
|
2
|
+
import { Observable, type Observer } from "../base";
|
|
5
3
|
import { EffectNode } from "./effectNode";
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { InitFunctionAsync } from "
|
|
2
|
-
import
|
|
3
|
-
import type { UpdateFunctionAsync } from "~/api/nodes/async/flowStateAsync";
|
|
4
|
-
import type { NotPromise } from "~/api/nodes/utils";
|
|
5
|
-
import { AsyncScheduler } from "~/schedulers";
|
|
1
|
+
import type { DerivationFunctionAsync, InitFunctionAsync, NotPromise, UpdateFunctionAsync } from "../api";
|
|
2
|
+
import { AsyncScheduler } from "../schedulers";
|
|
6
3
|
import { ValueNode } from "./valueNode";
|
|
7
4
|
|
|
8
5
|
/**
|
package/src/nodes/valueNode.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type {
|
|
2
|
+
FlowEffect,
|
|
3
|
+
FlowOnDataListener,
|
|
4
|
+
FlowOnErrorListener,
|
|
5
|
+
FlowOnPendingListener,
|
|
6
|
+
FlowTracker,
|
|
7
|
+
NotPromise,
|
|
8
|
+
} from "../api";
|
|
9
|
+
import { ExecutionStack, Node, type ObservableStatus, type Observer } from "../base";
|
|
10
|
+
import { PendingError, type Scheduler } from "../schedulers";
|
|
7
11
|
import { EffectNode } from "./effectNode";
|
|
8
12
|
|
|
9
13
|
/**
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { InitFunction } from "
|
|
2
|
-
import
|
|
3
|
-
import type { UpdateFunction } from "~/api/nodes/sync/flowState";
|
|
4
|
-
import type { NotPromise } from "~/api/nodes/utils";
|
|
5
|
-
import { SyncScheduler } from "~/schedulers";
|
|
1
|
+
import type { DerivationFunction, InitFunction, NotPromise, UpdateFunction } from "../api";
|
|
2
|
+
import { SyncScheduler } from "../schedulers";
|
|
6
3
|
import { ValueNode } from "./valueNode";
|
|
7
4
|
|
|
8
5
|
/**
|