0.1.5 • Published 11 months ago

@coaction/pinia v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@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.

0.1.5

11 months ago

0.1.4

11 months ago

0.1.0

11 months ago