@everystate/core 1.0.6 → 1.0.8
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/README.md +14 -5
- package/everyState.js +3 -3
- package/package.json +1 -1
- package/self-test.js +2 -2
- package/tests/core.test.js +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @everystate/core v1.0.
|
|
1
|
+
# @everystate/core v1.0.8
|
|
2
2
|
|
|
3
3
|
**EveryState: Observable state management with dot-path addressing**
|
|
4
4
|
|
|
@@ -122,7 +122,7 @@ EveryState is a reactive state management library where:
|
|
|
122
122
|
- **Atomic batching**: Multiple writes, single notification per path
|
|
123
123
|
- **Path introspection**: `has()` and `keys()` for runtime path discovery
|
|
124
124
|
- **Zero dependencies**: ~2KB minified
|
|
125
|
-
- **Framework-agnostic**: Works with React, Vue, Angular, Svelte, or vanilla JS
|
|
125
|
+
- **Framework-agnostic**: Works with React, Vue, Angular, Solid, Svelte, or vanilla JS
|
|
126
126
|
|
|
127
127
|
## Why EveryState?
|
|
128
128
|
|
|
@@ -138,20 +138,29 @@ EveryState makes state **addressable, observable, and testable** without special
|
|
|
138
138
|
| Package | Description | License |
|
|
139
139
|
|---|---|---|
|
|
140
140
|
| [@everystate/aliases](https://www.npmjs.com/package/@everystate/aliases) | Ergonomic single-character and short-name DOM aliases for vanilla JS | MIT |
|
|
141
|
+
| [@everystate/angular](https://www.npmjs.com/package/@everystate/angular) | Angular adapter: `usePath`, `useIntent`, `useWildcard`, `useAsync` - bridges store to Angular signals | MIT |
|
|
141
142
|
| [@everystate/core](https://www.npmjs.com/package/@everystate/core) | Path-based state management with wildcard subscriptions and async support. Core state engine (you are here). | MIT |
|
|
142
143
|
| [@everystate/css](https://www.npmjs.com/package/@everystate/css) | Reactive CSSOM engine: design tokens, typed validation, WCAG enforcement, all via path-based state | MIT |
|
|
143
144
|
| [@everystate/examples](https://www.npmjs.com/package/@everystate/examples) | Example applications and patterns | MIT |
|
|
144
145
|
| [@everystate/perf](https://www.npmjs.com/package/@everystate/perf) | Performance monitoring overlay | MIT |
|
|
145
146
|
| [@everystate/react](https://www.npmjs.com/package/@everystate/react) | React hooks adapter: `usePath`, `useIntent`, `useAsync` hooks and `EventStateProvider` | MIT |
|
|
146
|
-
| [@everystate/renderer](https://www.npmjs.com/package/@everystate/renderer) | Direct-binding reactive renderer: `bind-*`, `set`, `each` attributes. Zero build step |
|
|
147
|
+
| [@everystate/renderer](https://www.npmjs.com/package/@everystate/renderer) | Direct-binding reactive renderer: `bind-*`, `set`, `each` attributes. Zero build step | MIT |
|
|
147
148
|
| [@everystate/router](https://www.npmjs.com/package/@everystate/router) | SPA routing as state | MIT |
|
|
148
|
-
| [@everystate/
|
|
149
|
+
| [@everystate/solid](https://www.npmjs.com/package/@everystate/solid) | Solid adapter: `usePath`, `useIntent`, `useWildcard`, `useAsync` - bridges store to Solid signals | MIT |
|
|
150
|
+
| [@everystate/test](https://www.npmjs.com/package/@everystate/test) | Event-sequence testing for UIstate stores. Zero dependency. | MIT |
|
|
151
|
+
| [@everystate/types](https://www.npmjs.com/package/@everystate/types) | Typed dot-path autocomplete for EveryState stores (you are here) | MIT |
|
|
149
152
|
| [@everystate/view](https://www.npmjs.com/package/@everystate/view) | State-driven view: DOMless resolve + surgical DOM projector. View tree as first-class state | MIT |
|
|
153
|
+
| [@everystate/vue](https://www.npmjs.com/package/@everystate/vue) | Vue 3 composables adapter: `provideStore`, `usePath`, `useIntent`, `useWildcard`, `useAsync` | MIT |
|
|
150
154
|
|
|
151
155
|
## Documentation
|
|
152
156
|
|
|
153
|
-
Full documentation
|
|
157
|
+
Full documentation available at [everystate.dev](https://everystate.dev).
|
|
158
|
+
|
|
159
|
+
Source code: [https://github.com/ImsirovicAjdin/everystate-core](https://github.com/ImsirovicAjdin/everystate-core)
|
|
154
160
|
|
|
155
161
|
## License
|
|
156
162
|
|
|
157
163
|
MIT © Ajdin Imsirovic
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
package/everyState.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* EveryState v1.0.
|
|
2
|
+
* EveryState v1.0.8 - Optimized Path-Based State Management
|
|
3
3
|
*
|
|
4
4
|
* A lightweight, performant state management library using path-based subscriptions.
|
|
5
5
|
* Optimized for selective notifications and granular updates.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Selective subscriptions (only relevant subscribers fire)
|
|
10
10
|
* - Wildcard subscriptions (e.g., 'user.*' catches all user changes)
|
|
11
11
|
* - Global subscriptions (e.g., '*' catches all changes)
|
|
12
|
-
* - Atomic batching (batch/setMany
|
|
12
|
+
* - Atomic batching (batch/setMany - subscribers fire after all writes)
|
|
13
13
|
* - Zero dependencies
|
|
14
14
|
* - ~2KB minified
|
|
15
15
|
*
|
|
@@ -85,7 +85,7 @@ export function createEveryState(initial = {}) {
|
|
|
85
85
|
if (destroyed || listeners.size === 0) return value;
|
|
86
86
|
|
|
87
87
|
// Lazy detail allocation: only build the object when a listener is
|
|
88
|
-
// actually present. No closure is created
|
|
88
|
+
// actually present. No closure is created - the inline `||` re-uses
|
|
89
89
|
// the same object across exact / wildcard / global dispatch.
|
|
90
90
|
let detail = null;
|
|
91
91
|
|
package/package.json
CHANGED
package/self-test.js
CHANGED
|
@@ -251,13 +251,13 @@ console.log('\n11. fast-path: no detail allocated without listeners');
|
|
|
251
251
|
const s11 = createEveryState({ a: 0 });
|
|
252
252
|
let s11fires = 0;
|
|
253
253
|
|
|
254
|
-
// set with zero subscribers
|
|
254
|
+
// set with zero subscribers - fast-path should skip all dispatch
|
|
255
255
|
s11.set('a', 1);
|
|
256
256
|
s11.set('a', 2);
|
|
257
257
|
s11.set('a', 3);
|
|
258
258
|
assert('fast-path: value written without subscribers', s11.get('a') === 3);
|
|
259
259
|
|
|
260
|
-
// subscribe, fire, unsub, then set again
|
|
260
|
+
// subscribe, fire, unsub, then set again - fast-path should re-engage
|
|
261
261
|
const unsub11 = s11.subscribe('a', () => { s11fires++; });
|
|
262
262
|
s11.set('a', 4);
|
|
263
263
|
assert('fast-path: fires with subscriber', s11fires === 1);
|
package/tests/core.test.js
CHANGED
|
@@ -13,7 +13,7 @@ const results = runTests({
|
|
|
13
13
|
|
|
14
14
|
// -- batch ---------------------------------------------------------
|
|
15
15
|
|
|
16
|
-
'batch: coalesces
|
|
16
|
+
'batch: coalesces - same-path deduplication': () => {
|
|
17
17
|
const t = createEventTest({ count: 0 });
|
|
18
18
|
t.store.batch(() => {
|
|
19
19
|
t.trigger('count', 1);
|
|
@@ -51,7 +51,7 @@ const results = runTests({
|
|
|
51
51
|
store.destroy();
|
|
52
52
|
},
|
|
53
53
|
|
|
54
|
-
'batch: nested
|
|
54
|
+
'batch: nested - only outermost flushes': () => {
|
|
55
55
|
const t = createEventTest({ a: 0, b: 0 });
|
|
56
56
|
t.store.batch(() => {
|
|
57
57
|
t.trigger('a', 1);
|