@storix-js/core
v0.1.1
Published
Framework-agnostic state management core for Storix.
Readme
@storix-js/core
Framework-agnostic state management core for Storix.
Install
npm install @storix-js/coreWhat it includes
createStorix()for isolated store instancesdefineStore()withstate,getters,actions, andmodulesdefinePlugin()for lifecycle pluginscreateStoreManagerUI()for the in-page visual inspectorcreateExternalStoreBridge()for integrating external stores
Quick start
import { createStorix } from '@storix-js/core';
const storix = createStorix({ namespace: 'app' });
export const useCounterStore = storix.defineStore('counter', {
state: () => ({ count: 0 }),
getters: {
doubled: (state) => state.count * 2
},
actions: {
increment() {
this.count = this.count + 1;
}
}
});Add plugins and adapters from the other @storix-js/* packages as needed.
