{"bugs":{"url":"https://github.com/vuejs/vuefire/issues"},"dist":{"shasum":"8fbbb963b5cccdd0f46cebf087b180a9112969a3","tarball":"https://registry.npmjs.org/vuexfire/-/vuexfire-3.0.0-alpha.14.tgz","fileCount":11,"integrity":"sha512-8g10+Corxgcjd+9tMGT2R2YYdDtgGeHOc5DDtqvoBEyxIe/Yz3c0L8DwCSqjV+Ed3MjID/rgGP3r9xDYGrrHcg==","signatures":[{"sig":"MEUCIQD//ifEIEGES8ZEjAv+BhUpvHGQBIIUSj6ZggWAKkXO9QIgVs1gW6ZkVy2pVVhqKk0gOPhrJU+HKMplk9MWAmuoX9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEqZ5CRA9TVsSAnZWagAAHoIP/jd5Aax96tdkyW8bCh5G\nQjcqZNC5bOA+kCyc4gv0Snvl/5vYtWJhHEhS/hVyJDAywddCdKbeasdCYjqz\nK3WI6HrU87KWCpxfy0LzfP1UtNEE9FPxshQcISiPsPchDW6OAjJVwT2Wtfs2\nBxGtVsWdDNGLT8Vpj84DrQwCLqPUuFO8WQi2wxZGvv0CzEMDJuQM+q0CAH7C\nnNPYy4qHhtVxetcrAsasZCEM4luNOFqVFfHODb6f65x30WwPWvuRQtLSls7y\niDLCLc//t0SgFbh39Shp7ZNVeuSOXDgaNdXPYBjDam4kvEtLOfJ4ccuhhZ09\nnImWUsuezJNX6iPKNETGzCA3b2h6PkuxhNVoVHCvn6h6FC2yY1rdFUloAk3F\n91y+iOPIuZP2llcJ2uRQDgdjmdlgb4Z+kU2W5wLVCi4GtRwhzDuQB0sYViVp\nmzh5DwvmHJC6fyYxBjGy9ljh2TQuGODW8xtGZNuG6CSTj1Xc4Z0vsB/RfwF2\nVubrb2yxHQjiRSbrRXost/GwsO06nWgSwA5YbPOZ1YqBldXvR+uqOZM76mwA\nffxjg7aUsAMVRUga/EAg5JnhelN9TVpnUduNXNGii0E8k9iHqmH9IpBX5mAj\nPPCqrIDQrQolUqjJIR8ayNaNCrtbIDoidx6qo3PPEh+i5uf3WTmUm2M/uXdr\nO5UD\r\n=dVVp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/vuexfire.common.js","name":"vuexfire","types":"types/index.d.ts","unpkg":"dist/vuexfire.js","author":{"name":"Eduardo San Martin Morote"},"module":"dist/vuexfire.esm.js","readme":"# VuexFire [![Build Status](https://img.shields.io/circleci/project/posva/vuexfire/master.svg)](https://circleci.com/gh/posva/vuexfire) [![npm package](https://img.shields.io/npm/v/vuexfire.svg)](https://www.npmjs.com/package/vuexfire) [![coverage](https://img.shields.io/codecov/c/github/posva/vuexfire/master.svg)](https://codecov.io/github/posva/vuexfire) ![size](http://img.badgesize.io/posva/vuexfire/master/dist/vuexfire.min.js.svg?compression=gzip)\n\n> SSR ready Firebase binding for [Vuex](https://github.com/vuejs/vuex)\n\nSupports only Vue 2, Vuex 2 and Firebase JavaScript SDK 2/3/4.\nIf you need an older version check the `v1` branch: `npm i -D vuexfire@v1`\n\n## Installation\n\n1. Using a CDN:\n\n``` html\n<script src=\"https://unpkg.com/vuexfire@next\"></script>\n```\n\n2. In module environments, e.g CommonJS:\n\n``` bash\nnpm install vue firebase vuexfire@next --save\n```\n\n## Usage\n\nAdd the mutations to your root Store and make sure to define the property you\nwant to bind in the state first:\n\n``` js\nimport { firebaseMutations } from 'vuexfire'\nconst store = new Vuex.Store({\n  state: {\n    todos: [], // Will be bound as an array\n    user: null // Will be bound as an object\n  },\n  mutations: {\n    // your mutations\n    ...firebaseMutations\n  }\n})\n```\n\nIt works with modules as well, but **you don't need to add the mutations there**:\n```js\nconst store = new Vuex.Store({\n  modules: {\n    todos: {\n      state: {\n        todos: [], // Will be bound as an array\n        user: null // Will be bound as an object\n      },\n    }\n  }\n})\n```\n\nIn order to use VuexFire, you have to enhance actions. This action enhancer\ntakes the actual action and enhances it with two additional parameters in the\ncontext, `bindFirebaseRef` and `unbindFirebaseRef`:\n\n```js\nimport { firebaseAction } from 'vuexfire'\n\nconst setTodosRef = firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, { ref }) => {\n  // this will unbind any previously bound ref to 'todos'\n  bindFirebaseRef('todos', ref)\n  // you can unbind any ref easily\n  unbindFirebaseRef('user')\n})\n```\n\nAccess it as a usual piece of the state:\n\n```js\nconst Component = {\n  template: '<div>{{ todos }}</div>',\n  computed: Vuex.mapState(['todos']),\n  created () {\n    this.$store.dispatch('setTodosRef', db.collection('todos'))\n  }\n}\n```\n\n## Browser support\n\nVuexFire requires basic `WeakMap` support, which means that if you need to\nsupport any of these browsers:\n\n- IE < 11\n- Safari < 7.1\n- Android < 5.0\n\nYou'll have to include a polyfill. You can\nuse [atlassian/WeakMap](https://github.com/atlassian/WeakMap).\n\nYou can find more information about `WeakMap`\nsupport [here](http://kangax.github.io/compat-table/es6/#test-WeakMap).\n\n## How does it work?\n\nVuexFire uses multiple global mutations prefixed by `vuexfire/` to call the\nactual mutations to modify objects and arrays. It listens for updates to your\nfirebase database and commits mutations to sync your state. Thanks to the action\nenhancer `firebaseAction`, it gets access to the local `state` and `commit` so\nit works with modules too :+1:\n\n## Examples\n\nYou can check out a complete example in the `/examples` directory.\n\n## API\n\n### firebaseMutations\n\nThis object contains VuexFire internal mutations. They are all prefixed by\n`vuexfire/`. This object must be added in the root Store mutations object.\n\n### bindFirebaseRef(key, ref)\n\n_Only available inside of an enhanced action_\n\nBinds a firebase reference to a property in the state. If there was already\nanother reference bound to the same property, it unbinds it first.\n\n```js\nbindFirebaseRef('todos', ref)\n```\n\nReturns a promise which will resolve when the data is ready, or throw an error if something goes wrong:\n\n```js\nbindFirebaseRef('todos', ref).then(() => {\n  commit('setTodosLoaded', true)\n}).catch((err) => {\n  console.log(err)\n})\n```\n\n### unbindFirebaseRef(key)\n\n_Only available inside of an enhanced action_\n\nUnbinds a bound firebase reference to a given property in the state.\n\n```js\nunbindFirebaseRef('todos')\n```\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\n## Support on Beerpay\nHey dude! Help me out for a couple of :beers:!\n\n[![Beerpay](https://beerpay.io/posva/vuexfire/badge.svg?style=beer-square)](https://beerpay.io/posva/vuexfire)  [![Beerpay](https://beerpay.io/posva/vuexfire/make-wish.svg?style=flat-square)](https://beerpay.io/posva/vuexfire?focus=wish)\n","browser":"dist/vuexfire.esm.js","gitHead":"4d9e35500575630de9e367d0ec93118e19cacacc","license":"MIT","scripts":{"dev":"npm-watch","lint":"eslint --color --ext=js,html src test examples","test":"npm run build && npm run types","build":"node --eval 'require(\"@posva/vuefire-bundler\")(\"Vuexfire\")'","types":"tsc -p ./types/test/tsconfig.json","pretest":"npm run lint","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","dev:test":"npm run test:unit -- --watch","test:unit":"ava","postversion":"npm run build","test:coverage":"nyc npm run test:unit"},"_npmUser":{"name":"posva","email":"posva13@gmail.com"},"homepage":"https://github.com/vuejs/vuefire#readme","keywords":["vuex","fire","vue","realtime","database","google","firebase","redux","firestore","store","bind","opinionated"],"repository":{"url":"git+https://github.com/vuejs/vuefire.git","type":"git"},"description":"Firestore binding for Vuex","directories":{},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2018 Eduardo San Martin Morote\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","maintainers":[{"name":"posva","email":"posva13@gmail.com"}],"sideEffects":false,"dependencies":{"@posva/vuefire-core":"^1.0.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"vuex":"^3.0.1","eslint":"^5.9.0","codecov":"^3.1.0","typescript":"^3.2.1","babel-preset-env":"^1.7.0","@posva/vuefire-bundler":"^1.1.2","eslint-plugin-vue-libs":"^3.0.0","@posva/vuefire-test-helpers":"^1.0.2"},"peerDependencies":{"firebase":">= 4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vuexfire_3.0.0-alpha.14_1544726136520_0.9361007377642132","host":"s3://npm-registry-packages"},"_id":"vuexfire@3.0.0-alpha.14","version":"3.0.0-alpha.14"}