{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"9812e98a9509f56ce09792621c1d86ec4516f296","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.136.1-canary.5.tgz","fileCount":21,"integrity":"sha512-x1Qwps/xFS95HRhnhXMZdTJdEkiXdyZCvpYDH6PHh3fa5mKW0DCIDSbqaTXQuoprEnv5NF0X8HfcAKEsC2N88A==","signatures":[{"sig":"MEQCIAZYACh9qIq+2b8ld7tXtUIvaka9yJyycbacJgMjJY1jAiBtM4AVItrdqC+W4EnKnym2rHaREF7qSBeoP8DqXII/qw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7X2LCRA9TVsSAnZWagAAM4kP/27LjOE+lrV/AY4G73Ar\nseVI/t+Hc741MCVQGxMF2DSOWkDT66OcSs06Ufts2Kz2tE6wBOvtBf0K/9bf\nxaVZd/WM+rwc4wyO3GrUGplg0xurmofsV1osaN3HLl1h+2Eq7OZj3pvEhzBG\n3/ngXgpfzXzPy2fwzpC5q9G2RnPDAjD7aNbyFicwsDBr8HhEpTlyR0Lme1my\n2VOD3N/1a3R/CVkX/2o4JQwy48uwbyFN4rtwN7ZYYSwIGtCEg5neLCC1ZvHI\nBI98uuuacNmqsqCL+F2Y7Vk1uOsQNMKDhrQZ5cJFM5s7xI/rCGswjI9cq6I7\nMjLB2KnEVQ/VjVgLLGsKInrx3Qo8rG4m4E7+EGEapi016qBKeD78O829z8rb\ngCpQeMRNNS2xf6hT5DtNIk/RJ0VDMOkolWlRlwQZzj99KdpJMw+RkGzRXYZG\nM3d8U8JgMw7Sqk69bNS1IMqdWCOCwVjD/Hdket3OCzJHRf6fcHIRCf9kguwT\nmBnl+rQPYSCjlW6NVK2qFfW7wl5Re9g2UDC5ASrJ5q45ISyvfHVvBRhOH0+u\nRh0fz6IR88kNVzPJxAlBbU1nOJ1tlnZuPKK9LlHnf0SoJTFoB55iva9pWV3Q\nVmpFgpAFGQBB4gaNlLRC6h8UtR0fosO8fZt+XAlExltX2EGaD6gxpAYJPujS\nbZ4R\r\n=n/ej\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","_from":"file:sanity-document-store-0.136.1-canary.5.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":"8353bbe05e9bc8e93fcb227b90d74dd4eca5bf13","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":"bjoerge","email":"bjoerge@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":"simenss","email":"simen@bengler.no"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"thomax","email":"thomas@sanity.io"}],"_nodeVersion":"10.9.0","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.136.1-canary.5+8353bbe05"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.136.1-canary.5_1542290826455_0.9912052143363763","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.136.1-canary.5","version":"0.136.1-canary.5"}