@hellajs/store
v1.0.5
Published
A deeply reactive store for managing application state. Automatically converts nested objects into granular signals with flexible readonly controls.
Readme
@hellajs/store
A deeply reactive store for managing application state. Automatically converts nested objects into granular signals with flexible readonly controls.
Documentation
Quick Start
Installation
npm install @hellajs/core @hellajs/storeBasic Usage
import { effect } from '@hellajs/core';
import { store } from '@hellajs/store';
const user = store({
name: 'John',
age: 30,
settings: {
theme: 'dark'
}
});
// Effects react to any deep change
effect(() => {
console.log(`Theme is: ${user.settings.theme()}`);
});
// Update nested properties
user.name('Jane');
user.settings.theme('light'); // Effect re-runs
// Replace or update the entire state
user.set({ name: 'Sam', age: 25, settings: { theme: 'blue' } });
user.update({ settings: { theme: 'green' } });License
This software is provided "as is" under the MIT License, without any warranties. The authors are not liable for any damages arising from its use.
