{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"310dc82f856f05adbc3f3eecd12ea0a1fc60fd48","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.136.1-canary.33.tgz","fileCount":21,"integrity":"sha512-Q2IpBoY2zEm6Bhd0Gfn3+WBRFufMgGJ11f5sMXesJh6rYFTKQWnGulZWFjsZTPDap3Ftwbrtf36w/Ouqhy5nIw==","signatures":[{"sig":"MEUCIQCroQJM1pR6IjZn/sH4HEVMnjW2E3RKxw3lBTY3PsvY4QIgfwl6Kpy9EmD+fqDsbSnnjYyQv1CV1VFYGrS24uSEfJ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBTuiCRA9TVsSAnZWagAA6TcP/A3XT5i/+6gd4H0V8k2C\nnFK01IjaF0MRo9dWLl2LV3VBHj77sN2VFA2TiQDyLU3dG810pI4mm00MP4+x\neipTauvYc/vDAopJ+ZrqV4tasCDEWXOhGcB1n3gR3GJMS4FopGEDAUlCH8cr\nXWjK6gcClEMrM3Wr+xg5xKK4ZXND0SR4F25TpFw6D4GOta5x8AW1qdZjbnrH\nYb3/wKomM3oM+jIYkQmNiMlIpPjdXyandrCvdeK1smFH8a0zXHdCRtBpXhJn\n4AbkIUQW7plziTBPfb5M533Fa7gua0b9cP/Z7exe3o7t4Wl6+1QGqo02C4R/\nC/PwzQT/aJl+8I8b29rCse+2Q77KxfDzD25eTkf4NaCv5fDHrK8QrQLo8JON\nu9Pw9lwH44Nhm+gkSYrffmV3bGJo5k8ssDRyJ7T8tv9AiM+JfewOKTArS/23\nqob4GV9qJRaamhTQJMpI6MXmE03QRIbgY5kPYytY4wmlqyAvgk3vOiekHLor\nr78pJxrbiMupMvEC0EuFClNdhcQfg+ziGuD50tOpvxqeKTHh6Yg/X4PHFTLb\nSvFJRhuq2n3eKVAE658q/o6XjJztuIoHVUDz8qQZKAJprmwcrlyzF8bEFXU0\n5eCKlPeDijXVkox2W0LdHXo1BaAllttaJBi3BtKOHm67sg6+FCk+5i/Zc693\nTGnT\r\n=26Nc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","_from":"file:sanity-document-store-0.136.1-canary.33.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":"894f9db9be065fec93e1a21e836bee8fea733659","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":"rexxars","email":"espen@hovlandsdal.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.8.0","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.136.1-canary.33+894f9db9b"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.136.1-canary.33_1543846817431_0.8179484521639537","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.136.1-canary.33","version":"0.136.1-canary.33"}