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.
Files changed (49) hide show
  1. package/dist/{action-creator-c292nK7v.d.ts → action-creator-BrZF6hXc.d.ts} +4 -8
  2. package/dist/actions.d.ts +6 -6
  3. package/dist/actions.js +1 -1
  4. package/dist/{context-plugin-1pYmSQEG.d.ts → context-plugin--HkNN1ha.d.ts} +1 -1
  5. package/dist/dev.d.ts +9 -8
  6. package/dist/dev.js +1 -1
  7. package/dist/effects.d.ts +2 -2
  8. package/dist/effects.js +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/match.d.ts +50 -0
  11. package/dist/match.js +1 -0
  12. package/dist/{module-BlF2KSgy.d.ts → module-DqKegXHt.d.ts} +44 -19
  13. package/dist/notrace/{action-creator-DKG_sIia.d.ts → action-creator-DHAEgwuh.d.ts} +4 -8
  14. package/dist/notrace/actions.d.ts +59 -24
  15. package/dist/notrace/actions.js +1 -1
  16. package/dist/notrace/{context-plugin-Dt1IgVo8.d.ts → context-plugin-BapQkGwQ.d.ts} +1 -1
  17. package/dist/notrace/effects.d.ts +2 -2
  18. package/dist/notrace/effects.js +1 -1
  19. package/dist/notrace/index.d.ts +2 -2
  20. package/dist/notrace/{plugin-B0AXKusc.d.ts → plugin-Cxadz6uU.d.ts} +2 -2
  21. package/dist/notrace/policies.d.ts +1 -1
  22. package/dist/notrace/redux.d.ts +1 -1
  23. package/dist/observable.d.ts +1 -1
  24. package/dist/oop.d.ts +131 -0
  25. package/dist/oop.js +1 -0
  26. package/dist/{plugin-CCYlC0XS.d.ts → plugin-DkXCvsmB.d.ts} +2 -2
  27. package/dist/policies.d.ts +1 -1
  28. package/dist/react.d.ts +1 -1
  29. package/dist/redux.d.ts +1 -1
  30. package/dist/scope.d.ts +8 -9
  31. package/dist/scope.js +1 -1
  32. package/dist/trace.d.ts +1 -1
  33. package/dist/types-KavbvHix.d.ts +25 -0
  34. package/docs/README.md +2 -0
  35. package/docs/actions.md +80 -36
  36. package/docs/guide.md +142 -18
  37. package/docs/hmr.md +6 -5
  38. package/docs/migrating-from-effector.md +49 -16
  39. package/docs/migrating-from-rxjs.md +17 -6
  40. package/docs/oop.md +286 -0
  41. package/docs/package.md +4 -0
  42. package/docs/plugins.md +284 -0
  43. package/docs/react.md +17 -5
  44. package/docs/scope.md +76 -36
  45. package/docs/stores.md +263 -109
  46. package/llms-full.txt +1232 -231
  47. package/llms.txt +2 -0
  48. package/package.json +20 -2
  49. 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.6.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.1 kB"
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)",
@@ -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 };