1.0.0 • Published 12 months ago

pinia-plugin-created v1.0.0

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

Create created lifecycle method in your pinia 🍍 store!

Installation

npm install pinia-plugin-created

Usage

import Vue from 'vue';
import { createPinia, PiniaVuePlugin, defineStore } from 'pinia';
import { PiniaPluginCreated } from 'pinia-plugin-created';

// install pinia
Vue.use(PiniaVuePlugin);

// create pinia
const pinia = new createPinia();

// install pinia plugin
pinia.use(PiniaPluginCreated);

You can then use a created option in your stores:

defineStore('id', {
  state() {
    return {
      ...
    };
  },
  created() {
    ...
  },
  actions: {
    ...
  },
})

License

MIT

1.0.0

12 months ago