{"id":24537444,"url":"https://github.com/paraself/vuexy","last_synced_at":"2025-04-15T01:31:08.536Z","repository":{"id":48033076,"uuid":"136064061","full_name":"paraself/vuexy","owner":"paraself","description":"A static typed wrapper for vuex","archived":false,"fork":false,"pushed_at":"2021-08-10T18:26:34.000Z","size":19,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T13:21:35.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paraself.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-04T18:04:38.000Z","updated_at":"2022-12-07T23:11:59.000Z","dependencies_parsed_at":"2022-08-12T17:10:40.429Z","dependency_job_id":null,"html_url":"https://github.com/paraself/vuexy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Fvuexy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Fvuexy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Fvuexy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paraself%2Fvuexy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paraself","download_url":"https://codeload.github.com/paraself/vuexy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248989053,"owners_count":21194521,"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":[],"created_at":"2025-01-22T14:12:43.650Z","updated_at":"2025-04-15T01:31:08.291Z","avatar_url":"https://github.com/paraself.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vuexy\nAn static typed wrapper for vuex.\nIt's still a proof of concept, bugs are everywhere, do not use in production\n\n## Usage\n\nIn main.ts\n\n``` typescript\nimport Vuex from 'vuex'\nimport { Vuexy } from 'vuexy'\n\nconst store = new Vuex.Store({\n  // ... initialize your vuex store\n})\n\nVuexy.init(store)\n```\n\nDefine you vuexy module.\n``` typescript\n// StoreCart.ts\nimport { VuexyModule, Mutation, Action, Getter } from '../index'\n\nclass StoreCart extends VuexyModule {\n  \n  // memeber variables become states\n  public count: number = 0\n  \n  @Mutation\n  add(payload?: any):void {\n    console.log(payload)\n    this.count++\n  }\n\n  @Action\n  async deferAdd():Promise\u003cany\u003e {\n    setTimeout(() =\u003e {\n      this.add()\n    }, 1000);\n  }\n\n  @Getter\n  getCount() { \n    return this.count\n  }\n}\n\n// this is IMPORTANT! export a singleton via parent's factory function\nexport default StoreCart.Instance\u003cStoreCart\u003e(StoreCart)\n```\n\nUse your module\n``` typescript\n// MyComponent.vue\n\u003ctemplate\u003e\n// use your module states directly in template\n{{StoreCart.count}}\n\u003c/template\u003e\n\u003cscript lang=\"ts\"\u003e\nimport { Vue, Component } from 'vue-property-decorator'\nimport StoreCart from './StoreCart.ts'\n@Component\nexport default class MyComponent extends Vue {\n  private StoreCart: any = StoreCart\n\n  // use mutation or actions in functions\n  myFunc () {\n    this.StoreCart.deferAdd()\n      .then(this.StoreCart.add)\n  }\n\n  // can also assign member variable to StoreCart's state\n  count = StoreCart.count\n  deferAdd = StoreCart.deferAdd\n  add = StoreCart.add\n}\n\u003c/script\u003e\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaself%2Fvuexy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparaself%2Fvuexy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparaself%2Fvuexy/lists"}