{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"24c8adb2f8a8e5b2c4b09a363cb70f64cd79eb01","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.135.0-beta.0.tgz","fileCount":20,"integrity":"sha512-+uANvxFZwh1+1pIJCQppbCW/y41k7PittCLyLekeYv+scp+9bpITGviB8GEYucPzzxMRbwm1oo08QyUwO1Vkyw==","signatures":[{"sig":"MEYCIQC+moT/WpPYn3XZQTAW3scfSqquYfbsxFvF0KZrgIFIRQIhAMn8R9dvO77upGiQdIkeZRaIDIswld4IdmaZP8OdSOjr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbq2n3CRA9TVsSAnZWagAAaTYP/3aq6RaInn6Eelv5+eC+\ny6RFB3rHG4vy9OvWS7lUNSq9eTYudlgeh1m8me5UkxNGv9mpteE6zUy4ZCJv\nkZE3U8kKQe2TJYlTBSymm8YHk/1qaqQuASLSlgZSmOJCbTjm5Zxrdqpkd2tU\nWRi4wthBJeTmYgmmnxY8jCgP6hQBdUigwrNcPAeQy22sB7gaN2nueg/8ADWn\nV8GxYeBV0a/i2GznH42ir4yDMaj8drHFVeU4Cw/lgOp8dJgOWf/bBJNdytDc\nHL9ueQ+oKYiJOWu42aa5m1VnetsVN7CWGtzGQuZhIIdGmVvyb7HJkhJCqvxM\nSVw1lSqdU4G3ffMG6WIXv9DmLBqMtR0rInte9wsa1y4FUX1W3xMj7KjBSnm9\nBez4wRe1l7pI8Rr43+tvkk+3hqV0DRrvqxRPUnVjfKH8O5FQmqleAxPB6woT\np5QZDbe+6wkrl6oPSHyrgxRuduVwfveGT2ClrzB2pk5RCTw3thXUFUMMUq6a\nxyi+xB2tkxKpii4tMDR9ShyQ7dYgQG60i+xosMY25hwQPQEgGsLEps3nrz6h\ntrzjQoA69oP1s2CSMbX/6HCi0OwpaA6772QBaS9apGfdkb5FW2wud40iVB2E\nw5UL95w9P0vUC9hmgvborVZm/puBT0EEj3U9fHrujTqMEhawetL9W/Gi+g23\ngrRw\r\n=3vSR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","_from":"file:sanity-document-store-0.135.0-beta.0.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":"6d7d358444909ceeea5fffd2ba0564431f9b514f","license":"MIT","scripts":{"tap":"tap --node-arg=--require --node-arg=babel-register test/*.test.js","test":"npm run tap && npm run examples","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@bengler.no"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"simenss","email":"simen@bengler.no"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"thomax","email":"thomas@bengler.no"}],"_nodeVersion":"8.9.1","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.135.0-beta.0+6d7d35844"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tap":"^11.0.1","rimraf":"^2.6.2","in-publish":"^2.0.0","get-random-values":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/document-store_0.135.0-beta.0_1537960438073_0.2334201793652757","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.135.0-beta.0","version":"0.135.0-beta.0"}