@coaction/pinia
v0.1.5
Published
A Coaction integration tool for Pinia
Downloads
183
Readme
@coaction/pinia
A Coaction integration tool for Pinia
Installation
You can install it via npm, yarn or pnpm.
npm install coaction @coaction/pinia
Usage
import { create } from 'coaction';
import { bindPinia } from '@coaction/pinia';
import { defineStore } from 'pinia';
const useStore = create(() =>
defineStore(
'test',
bindPinia({
state: () => ({ count: 0 }),
getters: {
double: (state) => state.count * 2
},
actions: {
increment(state) {
state.count += 1;
}
}
})
)
);
Documentation
You can find the documentation here.