{"id":21543043,"url":"https://github.com/adamsol/vue-component-store","last_synced_at":"2026-05-21T04:02:53.712Z","repository":{"id":46119656,"uuid":"389370489","full_name":"adamsol/vue-component-store","owner":"adamsol","description":"Plugin for keeping the state of your Vue.js application inside components.","archived":false,"fork":false,"pushed_at":"2022-08-13T13:56:32.000Z","size":249,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T07:38:32.226Z","etag":null,"topics":["component","inject","provide","reactive","store","vue","vuex"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamsol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-25T14:45:47.000Z","updated_at":"2021-12-22T06:58:44.000Z","dependencies_parsed_at":"2022-09-02T17:09:09.971Z","dependency_job_id":null,"html_url":"https://github.com/adamsol/vue-component-store","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2Fvue-component-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2Fvue-component-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2Fvue-component-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsol%2Fvue-component-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamsol","download_url":"https://codeload.github.com/adamsol/vue-component-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130283,"owners_count":20402753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","inject","provide","reactive","store","vue","vuex"],"created_at":"2024-11-24T05:12:42.641Z","updated_at":"2026-05-21T04:02:48.675Z","avatar_url":"https://github.com/adamsol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"vue-component-store\n===================\n\n[![License](https://img.shields.io/github/license/adamsol/vue-component-store.svg)](https://github.com/adamsol/vue-component-store/blob/master/LICENSE.txt)\n[![CI](https://github.com/adamsol/vue-component-store/actions/workflows/ci.yml/badge.svg)](https://github.com/adamsol/vue-component-store/actions)\n[![npm](https://img.shields.io/npm/v/vue-component-store.svg)](https://www.npmjs.com/package/vue-component-store)\n\nA simple plugin for Vue.js 2.5–2.7, offering a clean way to keep the state of your application inside your components.\n\nThis library was inspired by https://github.com/LinusBorg/vue-reactive-provide. The basic idea is similar, but the API and implementation are different.\n\nWhy?\n----\n\n1. Vuex is centralized by design, but suggests dividing the store into modules to mimic the application's structure. This usually requires a lot of boilerplate. It's easier to use the existing component hierarchy and Vue's reactivity system directly instead.\n2. Vue has a `provide`/`inject` mechanism for passing data down the component hierarchy without chains of props, but [it's not reactive by default](https://github.com/vuejs/vue/issues/7017).\n\nInstallation\n------------\n\n```sh\nnpm install vue-component-store\n```\n\n```js\nimport VueComponentStore from 'vue-component-store';\n\nVue.use(VueComponentStore);\n```\n\nAPI\n---\n\nYou can use the following new options in your components:\n\n* `provideFields` – A list of fields (from `props`, `data`, or `computed`) to share with the descendant components. The fields will be reactive (one-way binding, like props).\n* `injectFields` – A list of fields (provided by ancestor components) to use in the current component. The effect is similar to using `mapState` and `mapGetters` from Vuex.\n* `provideMethods` – A list of methods to share with the descendant components.\n* `injectMethods` – A list of methods (provided by ancestor components) to use in the current component. This is functionally equivalent to bare `inject`, but exists for consistency of the API. The effect is similar to using `mapActions` from Vuex.\n\nIn order to share global state between all components in your application, use `provideFields`/`provideMethods` in the root component.\n\nExample\n-------\n\nSee https://github.com/adamsol/vue-component-store/tree/master/test/components/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsol%2Fvue-component-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamsol%2Fvue-component-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsol%2Fvue-component-store/lists"}