@valtrem/sync
v1.6.2
Published
```shell npm install @valtrem/sync ```
Downloads
59
Readme
@valtrem/sync
Installation
npm install @valtrem/sync
Usage
In vuex store.ts register modules as you would for any other modules. Then, pass store and configuration options to sync package.
For exemple :
#store.ts
import { Clients } from '@/store/modules/Client';
import { Projects } from '@/store/modules/Project';
import { Authentication } from '@valtrem/sync/src/store/Authentication';
import { Connectivity } from '@valtrem/sync/src/store/Connectivity';
Vue.use(Vuex);
const store = new Vuex.Store({
modules: {
authentication: new Authentication(),
connectivity: new Connectivity(),
projects: new Projects(),
clients: new Clients(),
}
});
const config = {
apiUrl: process.env.VUE_APP_API_URL,
storeNames: ['projects', 'clients']
};
sync(store, config);
export default store;