@coaction/pinia
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

@coaction/pinia

Node CI npm license

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.

Readme

Keywords

Package Sidebar

Install

npm i @coaction/pinia

Weekly Downloads

183

Version

0.1.5

License

MIT

Unpacked Size

24.2 kB

Total Files

10

Last publish

Collaborators

  • unadlib