{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"838b85e1835383117de89865b75d62bc5378d2be","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.141.7-next.18.tgz","fileCount":21,"integrity":"sha512-s/PJBKqYF1a92rsYoKSrNicq3Ai/ftbja0shODPRTNJBLqIe21N1d3djRm7XZFxB4ElbzyRfSNn6+H55arTqng==","signatures":[{"sig":"MEUCIQC8GQG6SwzF7189H9emafrJymb9OE3QPr9mLKezut3R7wIgT37VO86muDsq52v/Pstl4s/qTsPnikXwp91+2SemwNU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUnWhCRA9TVsSAnZWagAAgzIP/js4dJT3m5NtAsVIt19h\n4Ef37vWXA2fYQAWhUaE8/XpLRs8mz5jSfuZAFwPoK1jzWnsW4SHNe99Fjr8S\ntpLh0YZR38b8wK9HrMyzqeAnEjr6VD1bm/0ogd2pYE+FzeX52zLyBzmL0/KQ\nAlwemOnOXYo8aH+ww+HHFXFQ4/I2fp4s8Isw9Er0KixUxIEnKjjqPVRh89Yh\nR8QTOOEvTzD0V46Kc1Jp2/Z2bBNjiwfVliz+1xqxUSslKXpCeADbHwiXt0Kk\ndR62NujhpCjJYlpAAn9++k3V7xvhg4odZ5XHvofo+WfZXvWb2enHwbOnFTt2\nfbKO9KyJc8QmpjMKmDITnuy/BRNAuvGooL/zpaH61Bj5TfahNmYC7wRRc2sh\nW7OD0wjPNfz2rnGXe/bBNKwi/7eGmA9OjCa8Rh52QLI2VSd9azPjj6StJfS0\naTWoZ3X3+Bps2xWILDodZd6ZYj5Q0dgMPYEycgQiRZnCBR4mRI12CzrpMc1I\nbb03+/G/4sEoilnAu9wt/jDrH/Md5CayZLXWrUXLtlukfIarjeO4caF/KulF\nIQ0v2o54Jp2Xr/DSjfGW5kqNNtNoIcpvv0TdE+vt1mV+ELS9kIZeaUjQPEpE\nkiC1947b6g8cBDl/QQ0ksmivS1aZy4uSj/TIn07bi6Ad4fEzSGS1xHTjesx6\nJ9V6\r\n=Jy2v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","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":"add49d7e462c999befdcfe5f9679975d4ddeb5cc","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"],"repository":{"url":"git+https://github.com/sanity-io/sanity.git","type":"git"},"_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (darwin)","description":"Sanity / gradient document store","directories":{},"maintainers":[{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"evenw","email":"even@sanity.io"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"kristofferj","email":"kristoffer@sanity.io"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.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"},{"name":"vicbergquist","email":"victoria.bergquist@gmail.com"}],"_nodeVersion":"10.15.3","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.141.7-next.18+add49d7e4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.141.7-next.18_1565685152854_0.7859726794602939","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.141.7-next.18","version":"0.141.7-next.18"}