vue-fn
vue-fn
A Vue 3 reactive function utility library providing domain-driven design patterns and reactive state management utilities.
Features
- Domain-Driven Design - Functional implementation of DDD patterns with events, aggregations, and plugins
- Modular Architecture - Multiple independently consumable modules with tree-shaking support
- Vue 3 Reactive - Built on
@vue/reactivityfor full reactive system integration - Type Safety - Complete TypeScript support for excellent developer experience
- Client/Server - Separate
domainmodule for browsers,domain-serverfor Node.js environments - Cross-Tab State -
shared-domainmodule provides cross-tab/window state sharing via BroadcastChannel API - Two-Way Binding -
bindRefandbindReactiveutilities for reactive data binding
Modules
| Package | Description |
|---|---|
@vue-fn/domain |
Vue-reactive domain implementation with aggregations, plugins, and event system |
@vue-fn/domain-server |
Server-side variant for Node.js environments |
@vue-fn/domain-shared |
Cross-tab/window shared state using BroadcastChannel API |
@vue-fn/timer |
Async utilities: createTimeout() for cancellable timeouts, createDeferred() for promises |
Documentation
Full documentation is available at https://alphafoxz.github.io/vue-fn
Installation
# Install the main domain module
npm install @vue-fn/domain
# Install other modules as needed
npm install @vue-fn/domain-shared
npm install @vue-fn/timer
Quick Start
import { createSingletonAgg } from '@vue-fn/domain';
import { ref } from 'vue';
const counter = createSingletonAgg(() => {
const count = ref(0);
return {
states: {
count,
},
commands: {
increment() {
count.value++;
},
},
};
});
// Use the aggregation
counter.api.commands.increment();
console.log(counter.api.states.count.value); // 1
License
UNLICENSED
Related Packages
Version History
Pre-releases (51)
| Version | Released | Vue | License |
|---|---|---|---|
| 0.4.1-rc | >=3.5.0 | Proprietary | |
| 0.4.0-rc | >=3.5.0 | Proprietary | |
| 0.3.0-rc | >=3.5.0 | Proprietary | |
| 0.2.0-rc | >=3.5.0 | Proprietary | |
| 0.1.0-rc.5 | >=3.5.0 | Proprietary | |
| 0.1.0-rc.4 | >=3.5.0 | Proprietary | |
| 0.1.0-rc.3 | >=3.5.0 | Proprietary | |
| 0.1.0-rc.2 | >=3.5.0 | Proprietary | |
| 0.1.0-rc.1 | >=3.5.0 | Proprietary | |
| 0.1.0-beta.2 | >=3.5.0 | Proprietary | |
| 0.1.0-beta.1 | >=3.5.0 | Proprietary | |
| 0.1.0-beta.0 | >=3.5.0 | Proprietary | |
| 0.0.3-alpha.38 | >=3.5.0 | Proprietary | |
| 0.0.3-alpha.37 | >=3.5.0 | Proprietary | |
| 0.0.3-alpha.0 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.36 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.35 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.34 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.33 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.32 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.31 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.30 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.29 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.28 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.27 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.26 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.25 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.24 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.23 | >=3.5.0 | Proprietary | |
| 0.0.3-aplha.22 | >=3.5.0 | Proprietary |
Showing the latest 30 of 51. See every release on npm