vue-fn 0.4.0-rc → 0.4.1-rc
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 +64 -2
- package/package.json +21 -3
package/README.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# vue-fn
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Vue 3 reactive function utility library providing domain-driven design patterns and reactive state management utilities.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Domain-Driven Design** - Functional implementation of DDD patterns with events, aggregations, and plugins
|
|
8
|
+
- **Modular Architecture** - Multiple independently consumable modules with tree-shaking support
|
|
9
|
+
- **Vue 3 Reactive** - Built on `@vue/reactivity` for full reactive system integration
|
|
10
|
+
- **Type Safety** - Complete TypeScript support for excellent developer experience
|
|
11
|
+
- **Client/Server** - Separate `domain` module for browsers, `domain-server` for Node.js environments
|
|
12
|
+
- **Cross-Tab State** - `shared-domain` module provides cross-tab/window state sharing via BroadcastChannel API
|
|
13
|
+
- **Two-Way Binding** - `bindRef` and `bindReactive` utilities for reactive data binding
|
|
14
|
+
|
|
15
|
+
## Modules
|
|
16
|
+
|
|
17
|
+
| Package | Description |
|
|
18
|
+
| :-------------------------------------------- | :------------------------------------------------------------------------------------------- |
|
|
19
|
+
| [`@vue-fn/domain`](libs/domain) | Vue-reactive domain implementation with aggregations, plugins, and event system |
|
|
20
|
+
| [`@vue-fn/domain-server`](libs/domain-server) | Server-side variant for Node.js environments |
|
|
21
|
+
| [`@vue-fn/domain-shared`](libs/domain-shared) | Cross-tab/window shared state using BroadcastChannel API |
|
|
22
|
+
| [`@vue-fn/timer`](libs/timer) | Async utilities: `createTimeout()` for cancellable timeouts, `createDeferred()` for promises |
|
|
23
|
+
|
|
24
|
+
## Documentation
|
|
25
|
+
|
|
26
|
+
Full documentation is available at [https://alphafoxz.github.io/vue-fn](https://alphafoxz.github.io/vue-fn)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Install the main domain module
|
|
32
|
+
npm install @vue-fn/domain
|
|
33
|
+
|
|
34
|
+
# Install other modules as needed
|
|
35
|
+
npm install @vue-fn/domain-shared
|
|
36
|
+
npm install @vue-fn/timer
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { createSingletonAgg } from '@vue-fn/domain';
|
|
43
|
+
import { ref } from 'vue';
|
|
44
|
+
|
|
45
|
+
const counter = createSingletonAgg(() => {
|
|
46
|
+
const count = ref(0);
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
states: {
|
|
50
|
+
count,
|
|
51
|
+
},
|
|
52
|
+
commands: {
|
|
53
|
+
increment() {
|
|
54
|
+
count.value++;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Use the aggregation
|
|
61
|
+
counter.api.commands.increment();
|
|
62
|
+
console.log(counter.api.states.count.value); // 1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
UNLICENSED
|
package/package.json
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-fn",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.1-rc",
|
|
4
|
+
"description": "A Vue 3 reactive function utility library providing domain-driven design patterns and reactive state management utilities.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"private": false,
|
|
8
8
|
"keywords": [
|
|
9
|
-
"vue"
|
|
9
|
+
"vue",
|
|
10
|
+
"vue3",
|
|
11
|
+
"vue-utils",
|
|
12
|
+
"reactivity",
|
|
13
|
+
"reactive",
|
|
14
|
+
"state",
|
|
15
|
+
"state-management",
|
|
16
|
+
"shared-state",
|
|
17
|
+
"cross-tab",
|
|
18
|
+
"domain-driven-design",
|
|
19
|
+
"event-driven",
|
|
20
|
+
"aggregation",
|
|
21
|
+
"event-bus",
|
|
22
|
+
"plugin-system",
|
|
23
|
+
"broadcast-channel",
|
|
24
|
+
"typescript",
|
|
25
|
+
"composition-api",
|
|
26
|
+
"server-side",
|
|
27
|
+
"ssr"
|
|
10
28
|
],
|
|
11
29
|
"author": {
|
|
12
30
|
"name": "AlphaFoxz",
|