{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"2a628e8102cdbdb1e033fb5a8b4f4f2e354b0575","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.138.0-realtime-block-editor.21.tgz","fileCount":22,"integrity":"sha512-F6/hCx71p56MJdEZAqMwyjGz2khZNQajXlxcAHBTcWwKHK8FUEC+TN4h4Y3nnoqGr4xN5dtBD1CcYMlJNDGDSg==","signatures":[{"sig":"MEQCIG8dMeX4pAcSeuPXjdyt2Nnckdkr7Ql3aKUA6sRBKFjUAiBGyPca2R94XBEjidcCCZG4p5aJO5AYfAYR72l2+8Tmng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcF48tCRA9TVsSAnZWagAAbx0QAJMtovw0p84eoZ41YI0U\nCSsvhR0EV+L2pwskcYZMJW4iqtL2ZNfpGalUgcXToNKw5t8VQJudFiZmNKuq\nE9cbwcAXnNc/wJy7FKwmtm9S30xAMg5GdfngA8AictfweT+PRCuIvJK231bL\nx8F57JRBJ71KLMhtegAs7x1BTbQ5CD+Nas33wtdJ7NKhTizDqhjOF54SQ5OZ\nSAoQMXkZZw2GeLAU6NFqAyihxTtFg68re5tvYsbaogcfPZ+4Z8f4TUYcmzuH\nuAMolrt5nncU+NG7+Z0guBN0+/919iVDZRY8wJE8szyizG8mT7xmo1Ik1kLV\nrhC0ImEQY87euMJSTyNm8VIbnXt+6B0QrXoKSJQxCjvzoeph4Da4NOdLdofn\nEcGPGnubQWTMgdD7BFk1tgsX8pjadxgi0mHsHCV7Vkd23IXfZeOt6AhySAI9\n43V/6csmSQS9TqZdxEA8t9d4L69A4tDZhwJYmckZAf9/teqLVvueLz/hADWz\n1qWId0oq4X/q1YpH1GtHuWD61QWqkn0TiTBrRmdJ4iQ5/7C7CsyE8ngv3yAm\nYd/YYrOtUG7hYmxYsz8p7SoDDJE8nsM1qo++7+w4eifLPyLc/m0GkoTyLdkN\nHHwcCQszME9vLHY1cXcgFyw/GAMe2LBVnwE9xCB9pmhZbegzlIXjl+7PGxfi\n0R98\r\n=3IUg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","_from":"file:sanity-document-store-0.138.0-realtime-block-editor.21.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":"790d1af43ef91f5c838103fc64df0df837bfe452","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.138.0-realtime-block-editor.21+790d1af43"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.138.0-realtime-block-editor.21_1545047853167_0.4805809394980247","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.138.0-realtime-block-editor.21","version":"0.138.0-realtime-block-editor.21"}