@nvs-pinia/client
v1.0.1
Published
Client side pinia composable
Downloads
28
Readme
Pinia Collection: client bundle 🍍
This repository contains the client bundle logic for @nvs-pinia/collection
.\
Installation
- Add Pinia to your project. Follow the guide here
- Add the client bundle to your project:
npm i @nvs-pinia/client
- Add the netvlies pinia collection to your project:
npm i @nvs-pinia/collection
- Create a compatible Pinia instance and provide custom options:
import { createApp } from 'vue';
import { usePiniaCollection } from '@nvs-pinia/client';
createApp({...}).use(usePiniaCollection({...}));
- Import the module(s) you need inside your
script setup
:import { useAuthentication } from '@nvs-pinia/collection';
- Use the imported module in the composition API or anywhere after initialization of Pinia. See the docs.
Usage of plugins without Pinia collection instance
By default, some of the plugins provided by this collection will be loaded on usage of usePiniaCollection
. If you have a Pinia instance of your own and just want to use some of these plugins, insert the following:
import { createPinia } from 'pinia';
import { useAPI } from '@nvs-pinia/client';
const pinia = createPinia();
pinia.use({ store } => {
store.$api = useAPI(...);
});
For more docs, follow the Pinia plugin guide
Contributing guide
- Clone this repo
- Make your changes and commit them according to our git commit format
- Submit PR and get it approved
- Merge PR to
release/{MR Creation year}{MR creation month}{3 digit number}
e.g.release/202206001
- Create new release with
npm run release
- Merge release to
main