@everystate/core 1.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/README.md +82 -0
- package/index.js +9 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# @everystate/core
|
|
2
|
+
|
|
3
|
+
**EveryState: Observable state management with dot-path addressing**
|
|
4
|
+
|
|
5
|
+
Every piece of state has a name. Every name is subscribable. Every operation is visible.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @everystate/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { createEventState } from '@everystate/core';
|
|
17
|
+
|
|
18
|
+
const store = createEventState({ count: 0, user: { name: 'Alice' } });
|
|
19
|
+
|
|
20
|
+
// Subscribe to specific path
|
|
21
|
+
const unsub = store.subscribe('count', (value) => {
|
|
22
|
+
console.log('Count changed:', value);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Update state
|
|
26
|
+
store.set('count', 1);
|
|
27
|
+
|
|
28
|
+
// Get state
|
|
29
|
+
const count = store.get('count');
|
|
30
|
+
|
|
31
|
+
// Wildcard subscription
|
|
32
|
+
store.subscribe('user.*', ({ path, value }) => {
|
|
33
|
+
console.log(`User field ${path} changed to:`, value);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Cleanup
|
|
37
|
+
unsub();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## What is EveryState?
|
|
41
|
+
|
|
42
|
+
EveryState is a reactive state management library where:
|
|
43
|
+
- Every value lives at a **named dot-path** (like `user.profile.name`)
|
|
44
|
+
- Every path is **subscribable** with wildcards (`user.*`)
|
|
45
|
+
- Every change is **observable** and traceable
|
|
46
|
+
- No magic, no proxies, no hidden dependency tracking
|
|
47
|
+
|
|
48
|
+
## Core Features
|
|
49
|
+
|
|
50
|
+
- **Path-based subscriptions**: Subscribe to exactly what you need
|
|
51
|
+
- **Wildcard support**: `user.*` catches all user changes
|
|
52
|
+
- **Atomic batching**: Multiple writes, single notification per path
|
|
53
|
+
- **Zero dependencies**: ~2KB minified
|
|
54
|
+
- **Framework-agnostic**: Works with React, Vue, Angular, Svelte, or vanilla JS
|
|
55
|
+
|
|
56
|
+
## Why EveryState?
|
|
57
|
+
|
|
58
|
+
State management shouldn't be a black box. You should be able to:
|
|
59
|
+
- Ask "which paths changed most often?"
|
|
60
|
+
- See "how long did that update take?"
|
|
61
|
+
- Know "which component is listening to this path?"
|
|
62
|
+
|
|
63
|
+
EveryState makes state **addressable, observable, and testable** without special tooling.
|
|
64
|
+
|
|
65
|
+
## Ecosystem
|
|
66
|
+
|
|
67
|
+
- `@everystate/core`: Core state engine (you are here)
|
|
68
|
+
- `@everystate/view`: DOM-as-state with surgical updates
|
|
69
|
+
- `@everystate/perf`: Performance monitoring overlay
|
|
70
|
+
- `@everystate/css`: Reactive styling and design tokens
|
|
71
|
+
- `@everystate/router`: SPA routing as state
|
|
72
|
+
- `@everystate/react`: React hooks adapter
|
|
73
|
+
- `@everystate/renderer`: Direct-binding reactive renderer
|
|
74
|
+
- `@everystate/event-test`: Zero-dependency testing
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
Full documentation: [https://github.com/ImsirovicAjdin/everystate-core](https://github.com/ImsirovicAjdin/everystate-core)
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT © Ajdin Imsirovic
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everystate/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "EveryState: Lightweight event-driven state management with path-based subscriptions, wildcards, and async support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"everystate",
|
|
9
|
+
"state-management",
|
|
10
|
+
"event-driven",
|
|
11
|
+
"reactive",
|
|
12
|
+
"zero-dependency",
|
|
13
|
+
"micro-framework",
|
|
14
|
+
"async-state",
|
|
15
|
+
"query-client",
|
|
16
|
+
"domless-testing",
|
|
17
|
+
"path-based",
|
|
18
|
+
"dot-path",
|
|
19
|
+
"observable"
|
|
20
|
+
],
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "Ajdin Imsirovic",
|
|
23
|
+
"url": "https://www.linkedin.com/in/ajdin-imsirovic"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/ImsirovicAjdin/everystate-core"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/ImsirovicAjdin/everystate-core#readme",
|
|
31
|
+
"files": [
|
|
32
|
+
"index.js",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@uistate/core": "^5.6.0"
|
|
37
|
+
}
|
|
38
|
+
}
|