{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"e652d63380e1bc7d0e14222ec3dd01555ac37dd2","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.137.0-realtime-block-editor.380.tgz","fileCount":22,"integrity":"sha512-7hnkCh15iI2/xbUWsi5eFi6oRbsJsdWaBMrOTCxshAb7sduQlNgfg8iccFf6UyMk+IqDvX6PuAdc9Qt2MpPwBg==","signatures":[{"sig":"MEYCIQClIoT8j/CHRTtsf+RFFS9srDFunqnEoDQWSaYFKubNbAIhAJNKJ5bh6eWvgFYsqBpBoH0AsYHJ2YD4rOOhhZqk7NOs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDuobCRA9TVsSAnZWagAAU6EP/2k5g7ub286oSLPH1wZP\nPi6b5P/evk7Omlu1tStilcLOhTpGO8wMd35uFIqaiqJXtlDJG6IUDX2Zoucq\nRvxXHU4S5L7mTdEsC6hDCRhv3MU4lCH35oyBFiM1VNGTx4v7OK4oN2BlAIG/\nYB113IO+PzY+dFEO4RnU+pmDd3qn0RJaqaiBetvYuMU5n+il1jbtMzi98N2t\nsVvTK4djGJQxdAi+rn1nPdAZ/sW/LgjaVSA6QdhsRynTghlbZUmi6hRH/NX5\nHuen5XgVKNgnwrUuBVa0lUM+JZHPQkvRVxaxAJbD+QD4sOVrYGbs3PXtVmfY\nt8Jt0T57bQN4jBEEwXszyK84NxIayu7v6LI1R4U0T9Qge3F+qQgsWHnbrgLj\nJ+rwmIAPhkb1jzzAoHXUWiObl6AGM/+HJZ0+N24WXqKDzNhVqUDT7Ko9I39K\nYPcJOFrrYIi9S1nAB6/nk30hY6xjKJ6ni/DOY/OxQSx1oPfGiHOPLcpQmE9Y\nugfz+u9MnnnQd/47ZjxBWDE0atNXnZOJR8n6S9HsIO+FQiQM3D7Qd9Gndgr2\n1PwnCLBp5IKslCFgJxwbuSkQRQXrrbQNiVa0H2yf0uVXhSkUt6J3+wzNowlT\nIbvIRpPPCJKrjWBIkGEycyPrKd3BBqRkjo2MlNbkp/9km70K1VAW/GQ1WrrY\nevpr\r\n=6xTQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","_from":"file:sanity-document-store-0.137.0-realtime-block-editor.380.tgz","author":{"name":"Sanity.io","email":"hello@sanity.io"},"readme":"# Document store\n\nSanity / gradient document store\n\n## Example\n```js\n// If you are interested in everything that happens with document `lol42`\nconst subscription = documents.byId(\"lol42\").subscribe(event => {\n  console.log('Something happened with document lol42!', event)\n})\n\n// After a while, when you are no longer interested in updates fom document `lol42`:\nsubscription.unsubscribe()\n```\n\n## How it works\nWhen you add a subscriber to a document the first thing that happens is that the subscriber function is called with a snapshot of the document's current state. This happens as soon as the snapshot is retrieved. If there is a cached version of it on the client, the snapshot is received immediately (synchronously).\n\nFrom that moment on, you will receive a new event every time something happens to the document, until you unsubscribe again.\n\n## API\n\n- `createDocumentStore({serverConnection: ServerConnection}) : DocumentStore`\n\nServerConnection must be an object with the following api:\n- `byId(id : string) : Observable<DocumentEvent>`\n- `query(query : string) : Observable<QueryResultEvent>`\n(todo, add more)\n\n### DocumentStore\n\n### Query methods\n- `byId(id : string) : Observable<DocumentEvent>`\n- `byIds(ids : Array<string>) : Observable<QueryResultEvent>`\n- `query(query : string) : Observable<QueryResultEvent>`\n\n### Mutation methods\n- `update(id : string, spec : UpdateSpec) : Observable<OperationEvent>`\n- `create(document : Document) : Observable<OperationEvent>`\n- `replace(documentId : string, document : Document) : Observable<OperationEvent>`\n- `createOrReplace(document : Document) : Observable<OperationEvent>`\n- `delete(documentId : string) :  : Observable<OperationEvent>`\n\n### Document\n- `_id : string`\n- `_type : string`\n\n### DocumentEventType\n\n### DocumentEvent\n- `type : string` either one of `snapshot`, `update`\n- `snapshot : Document`\n","gitHead":"a8e870d31432672cd5a039129b1100b877364797","license":"MIT","scripts":{"clean":"rimraf lib","examples":"echo 'Running examples'; for i in examples/*.js; do echo '\n## '$i' ----\n' && node $i; done"},"_npmUser":{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},"homepage":"https://www.sanity.io/","keywords":["sanity","cms","headless","realtime","content","document-store"],"_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/sanity-io/sanity.git","type":"git"},"_npmVersion":"6.4.1","description":"Sanity / gradient document store","directories":{},"maintainers":[{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"kristofferj","email":"kristoffer@sanity.io"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"simenss","email":"simen@bengler.no"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"thomax","email":"thomas@sanity.io"}],"_nodeVersion":"10.12.0","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.137.0-realtime-block-editor.380+a8e870d31"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.137.0-realtime-block-editor.380_1544481306594_0.13692254895293088","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.137.0-realtime-block-editor.380","version":"0.137.0-realtime-block-editor.380"}