{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"c96e3c4f15cb29a09fd24d020013a8ea0a86fc79","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.133.0-realtime-block-editor.72c3aa98.tgz","fileCount":19,"integrity":"sha512-kfsEM9zA7EACtcPH+IB2Z/yluRfrF1q8XJpjy/cVgaC32L3S4LvObksgJvuNUSNRJ9x5RPO2hmtG3ifqqDiX6Q==","signatures":[{"sig":"MEUCIQDsp5Ez3YaH6tb8eAWoGXYFUqYtIJKUTwZ5QhwLeKfQkgIgCEvvtk276sSCbzmlKRv7Pa/4yK3tfz//OcsM7job7xw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGnmQCRA9TVsSAnZWagAATpIP/jhdzOk7eTL4hDhx7MZV\nD5yvOI2NhI+qASAJCASfcMvXaHm0SqrZLIFyrH8Lv9ee/ZJ3FzehRmxND0j/\n3cz8qPkoqg23YdV2jLai/MMZax+A+gegO3eALU9mxyd2f91+Ej0CiJcNJbmY\nLWoA3q0mDxwYioH/CE73bnXJ6tiGmfJZzb8exO9PRhp612aHPg5hg7qQz8Ue\nOKlOyYt7dIDqDRcpy8zEIu/Mz0YgnHJjbQ1piZ9MXGb32qV/FsvjCYIKANyj\ny0+0CZn5UTSuYFWfCjckdIL+KCsuTZ8Ud+Uoh86T1zmsYPW/pPiaiDyc4rBt\n746fFExLsimY5r0afOSbYrnocWjRGDr+INfEPZdxZjcJm9TTdkQlZloYwR16\nb/NMd3PlNom+svYfzLt/KdD3LQZYTImRmmizpBZpL6G1EsC0gL9TZoycTmbH\nvxahEoNT3fe1AlmMDfhhKGu2o8eq/KVOL9Auem1UbarzRcKJo+JWc3R6wwv9\nXu/XJvySKKHmRRwChty0icM1sYlAjquFTuh2o+deS66HI1q4InK8/gN0boSZ\nOx8rBc6SNDLadadHWUn5NasVPHMXByeiHP19PT+ydpxaf5cuaoh6OYiTkT6j\nUfbIYuOF+HcslpLtbbnRv0Cyh0pxu/iIBWo7pcyHl/BTZf/AE4lkzZZDe7nL\nHkZk\r\n=3+hd\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","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":"sanity-io","email":"developers@sanity.io"},"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":"6.1.0","description":"Sanity / gradient document store","directories":{},"maintainers":[{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"kristofferj","email":"kristoffer@bengler.no"},{"name":"rexxars","email":"rexxars@gmail.com"},{"name":"sanity-io","email":"hello@sanity.io"},{"name":"simenss","email":"simen@bengler.no"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"thomax","email":"thomas@bengler.no"}],"_nodeVersion":"8.4.0","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.133.0-realtime-block-editor.72c3aa98"},"_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.133.0-realtime-block-editor.72c3aa98_1528461704412_0.6393042298979583","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.133.0-realtime-block-editor.72c3aa98","version":"0.133.0-realtime-block-editor.72c3aa98"}