Skip to content

Support created lifecycle hook in your pinia 🍍 store!

License

Notifications You must be signed in to change notification settings

zhennann/pinia-plugin-created

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Support created lifecycle hook 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

About

Support created lifecycle hook in your pinia 🍍 store!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published