{"action":"closed","issue":{"url":"https://api.github.com/repos/davestewart/vuex-pathify/issues/49","repository_url":"https://api.github.com/repos/davestewart/vuex-pathify","labels_url":"https://api.github.com/repos/davestewart/vuex-pathify/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/davestewart/vuex-pathify/issues/49/comments","events_url":"https://api.github.com/repos/davestewart/vuex-pathify/issues/49/events","html_url":"https://github.com/davestewart/vuex-pathify/issues/49","id":419115372,"node_id":"MDU6SXNzdWU0MTkxMTUzNzI=","number":49,"title":"How to extend Vue.prototype with Pathify helper functions?","user":{"login":"Zireael","id":3856578,"node_id":"MDQ6VXNlcjM4NTY1Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/3856578?v=4","gravatar_id":"","url":"https://api.github.com/users/Zireael","html_url":"https://github.com/Zireael","followers_url":"https://api.github.com/users/Zireael/followers","following_url":"https://api.github.com/users/Zireael/following{/other_user}","gists_url":"https://api.github.com/users/Zireael/gists{/gist_id}","starred_url":"https://api.github.com/users/Zireael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zireael/subscriptions","organizations_url":"https://api.github.com/users/Zireael/orgs","repos_url":"https://api.github.com/users/Zireael/repos","events_url":"https://api.github.com/users/Zireael/events{/privacy}","received_events_url":"https://api.github.com/users/Zireael/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-03-09T21:03:38Z","updated_at":"2019-03-20T16:53:20Z","closed_at":"2019-03-20T16:53:20Z","author_association":"NONE","body":"Hi,\r\nI'm trying to register Pathify helper functions globally in Vue instance so they are available in all components, but I'm getting the function text printout as output instead of invoking it.\r\nI'm trying to do it with a plugin install like so:\r\n\r\n```\r\nimport { get, set, sync, call } from \"vuex-pathify\";\r\n\r\nexport default {\r\n  install(Vue, options) {\r\n    Vue.prototype.$myget = get\r\n    Vue.prototype.$myset = set\r\n    Vue.prototype.$mysync = sync\r\n    Vue.prototype.$mycall = call\r\n  }\r\n};\r\n```\r\nWhen I try to do in a component:\r\n`var someVar = this.$myget(\"colours.colourForeground\");`\r\n\r\nI'm getting function text string\r\n\r\n```\r\nƒ () {\r\n    var args = [], len = arguments.length;\r\n    while ( len-- ) args[ len ] = arguments[ len ];\r\n\r\n    if (!this.$store) {\r\n      throw new Error('[Vuex Pathify] Unexpected condition: this.$store is…\r\n```\r\nI tried invoking get in a wrapper with argument passing like ` Vue.prototype.$myget: (arg) => get(arg)`, but no luck.\r\nIf I hardcode the argument \r\n`Vue.prototype.$myget = get(\"colours.colourForeground\")`\r\n I receive correct expected output (works as expected).\r\nShould I be binding the get/set/etc first and doing `this.get` etc in plugin install? Couldn't get that to work either. I'd appreciate your advice.\r\nWould global mixin be better idea?\r\n\r\nThanks in advance"}}
{"actor":{"display_login":"davestewart"}}