nanoeffects 0.6.0 → 0.8.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/{action-creator-c292nK7v.d.ts → action-creator-BrZF6hXc.d.ts} +4 -8
- package/dist/actions.d.ts +6 -6
- package/dist/actions.js +1 -1
- package/dist/{context-plugin-1pYmSQEG.d.ts → context-plugin--HkNN1ha.d.ts} +1 -1
- package/dist/dev.d.ts +9 -8
- package/dist/dev.js +1 -1
- package/dist/effects.d.ts +2 -2
- package/dist/effects.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/match.d.ts +50 -0
- package/dist/match.js +1 -0
- package/dist/{module-BlF2KSgy.d.ts → module-DqKegXHt.d.ts} +44 -19
- package/dist/notrace/{action-creator-DKG_sIia.d.ts → action-creator-DHAEgwuh.d.ts} +4 -8
- package/dist/notrace/actions.d.ts +59 -24
- package/dist/notrace/actions.js +1 -1
- package/dist/notrace/{context-plugin-Dt1IgVo8.d.ts → context-plugin-BapQkGwQ.d.ts} +1 -1
- package/dist/notrace/effects.d.ts +2 -2
- package/dist/notrace/effects.js +1 -1
- package/dist/notrace/index.d.ts +2 -2
- package/dist/notrace/{plugin-B0AXKusc.d.ts → plugin-Cxadz6uU.d.ts} +2 -2
- package/dist/notrace/policies.d.ts +1 -1
- package/dist/notrace/redux.d.ts +1 -1
- package/dist/observable.d.ts +1 -1
- package/dist/oop.d.ts +131 -0
- package/dist/oop.js +1 -0
- package/dist/{plugin-CCYlC0XS.d.ts → plugin-DkXCvsmB.d.ts} +2 -2
- package/dist/policies.d.ts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/redux.d.ts +1 -1
- package/dist/scope.d.ts +8 -9
- package/dist/scope.js +1 -1
- package/dist/trace.d.ts +1 -1
- package/dist/types-KavbvHix.d.ts +25 -0
- package/docs/README.md +2 -0
- package/docs/actions.md +80 -36
- package/docs/guide.md +142 -18
- package/docs/hmr.md +6 -5
- package/docs/migrating-from-effector.md +49 -16
- package/docs/migrating-from-rxjs.md +17 -6
- package/docs/oop.md +286 -0
- package/docs/package.md +4 -0
- package/docs/plugins.md +284 -0
- package/docs/react.md +17 -5
- package/docs/scope.md +76 -36
- package/docs/stores.md +263 -109
- package/llms-full.txt +1232 -231
- package/llms.txt +2 -0
- package/package.json +20 -2
- package/dist/types-mLaAx-EZ.d.ts +0 -15
package/llms.txt
CHANGED
|
@@ -16,6 +16,7 @@ Rules that generated code often gets wrong:
|
|
|
16
16
|
|
|
17
17
|
- [Guide](docs/guide.md): bus, handler context, policies, effects, commands and modules, step by step
|
|
18
18
|
- [Package entries](docs/package.md): which import holds what
|
|
19
|
+
- [Plugins](docs/plugins.md): every plugin of a bus, what `bus.use` returns, and the order to use them in
|
|
19
20
|
|
|
20
21
|
## Async UI and unreliable networks
|
|
21
22
|
|
|
@@ -30,6 +31,7 @@ Rules that generated code often gets wrong:
|
|
|
30
31
|
- [Build a sign-up form in React](docs/react.md): a form with a username check, a submit that cannot fire twice, and retry
|
|
31
32
|
- [Context fields](docs/context.md): put a store or client on every task
|
|
32
33
|
- [Scopes](docs/scope.md): fields for one command, action, job, module or `emit`, and a way to replace them in a test
|
|
34
|
+
- [Use the bus from a class](docs/oop.md): `extendBus`, `@WithBus`, `@On`, `@Once`, and `dispose()` for the subscriptions of an instance
|
|
33
35
|
|
|
34
36
|
## TypeScript
|
|
35
37
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nanoeffects",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Typed event bus where every handler is a task with an AbortSignal, plus policies (latest, debounce, throttle, queue), effects (retry, timeout, poll) and tracing. About 1.3 kB gzip.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"event-bus",
|
|
@@ -78,6 +78,14 @@
|
|
|
78
78
|
"types": "./dist/scope.d.ts",
|
|
79
79
|
"import": "./dist/scope.js"
|
|
80
80
|
},
|
|
81
|
+
"./match": {
|
|
82
|
+
"types": "./dist/match.d.ts",
|
|
83
|
+
"import": "./dist/match.js"
|
|
84
|
+
},
|
|
85
|
+
"./oop": {
|
|
86
|
+
"types": "./dist/oop.d.ts",
|
|
87
|
+
"import": "./dist/oop.js"
|
|
88
|
+
},
|
|
81
89
|
"./trace": {
|
|
82
90
|
"types": "./dist/trace.d.ts",
|
|
83
91
|
"import": "./dist/trace.js"
|
|
@@ -177,7 +185,17 @@
|
|
|
177
185
|
{
|
|
178
186
|
"name": "actions (all)",
|
|
179
187
|
"path": "dist/actions.js",
|
|
180
|
-
"limit": "2.
|
|
188
|
+
"limit": "2.65 kB"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "match (plugin)",
|
|
192
|
+
"path": "dist/match.js",
|
|
193
|
+
"limit": "0.5 kB"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "oop (class entry)",
|
|
197
|
+
"path": "dist/oop.js",
|
|
198
|
+
"limit": "2.5 kB"
|
|
181
199
|
},
|
|
182
200
|
{
|
|
183
201
|
"name": "scope (plugin and effect)",
|
package/dist/types-mLaAx-EZ.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { B as EventMap, d as Effects, o as Scope, s as WithFields } from "./action-creator-c292nK7v.js";
|
|
2
|
-
import { t as BoundOf } from "./plugin-CCYlC0XS.js";
|
|
3
|
-
//#region src/scope/types.d.ts
|
|
4
|
-
type BoundEffects<E extends EventMap, S extends Scope> = S extends {
|
|
5
|
-
effects: infer H extends Effects;
|
|
6
|
-
} ? BoundOf<H, E> : unknown;
|
|
7
|
-
/** The fields a scope gives a task: its values as they are and its `effects` bound; `unknown` for an empty scope. */
|
|
8
|
-
type FieldsOfScope<E extends EventMap, S extends Scope> = [keyof S] extends [never] ? unknown : Omit<S, "effects"> & BoundEffects<E, S>;
|
|
9
|
-
/**
|
|
10
|
-
* The event map `E` with the fields of a scope on top of its context fields.
|
|
11
|
-
* A field the scope sets replaces the one of the bus in the type too.
|
|
12
|
-
*/
|
|
13
|
-
type Scoped<E extends EventMap, S extends Scope> = WithFields<E, FieldsOfScope<E, S>>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { Scoped as n, FieldsOfScope as t };
|