{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"6464a07241307bde804aaca2550495d0adaab103","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.146.0-alpha.1.tgz","fileCount":21,"integrity":"sha512-VJ5EKLoxoRld72rfezGA2uKS3eK4JHm73PhMh6w5dH+ePQFvXME+QwFOSK++xiVfvgejSrVyql/eaqH7vIM5uQ==","signatures":[{"sig":"MEUCICS73YJOkq+FWOnlb6obcIBlc76J1A059mZQLfz18tAoAiEAlMxbQGIaH1eYG7ykCv0NBVzGTqzOwNn1c59hdILbdM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1IQnCRA9TVsSAnZWagAAFdkP/iI/i9uUeY+t9lpin6jk\nBByqa4FeOCgLdQZ6PV7g07xb36Cln2ggu1DeSqYvSGOZyJWWifFJ4xc7LZZB\nyKpao3lreIsSgXXvu5V85G0REyLZG8+iBVZACP+ziNRAFYBeDC4UvnLvOrLy\nBJP/6tlF8P0wuIYgfeK0lksMrtR5F3PRD7F+Xf/ZYC+XJKF6rHAQ1Jq5GVxW\nsSveEYB0pbF1hQnZIYiXNRM5UsXj1fhBeUPmjuChfDWhvWWs9xYw5PREjsWL\nRqqmCneNoTKs89i8R9YseycJ5FDNkzzkxGJduMfEUqAGd5PqKFp8IMdZ2cat\nVM8sftt5cn0/HkPVPriO23arWTKzDS3cvCD7ESz3jlOidZsHu2QvhyUksHlt\nAydFsh/9F1NgAhRrGFJCXxXxRodY3Dyft1WQdJdYtbrxXy3Bqt2pcbRaSvHY\ndrQQKNmgeKWxza1SJSwLuyLTM/CzetHaBp2Aczye7WrZ52vGMiBsyJw/MGcf\nvAMSTjgIb1mA3QzdMTHWWJTGZFNMpgWghZx7tiZGCIW8lnIZ1FvhTCu5/2RG\n8GfEunZp+/0D7EpRJoaZuEIiwjMIBh8y3rX57M3AMNYcVULm7qybSTYZOO9C\njyfMCU/yRVRDsMXAOL4KK+emIicO5/Kx+TSLG2gIB+32u5a/vYJF2rnL+SUx\nZo8P\r\n=s5Fx\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":"f2d2a93780d047c5653be74a8a87840b1b1cc8fe","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"],"repository":{"url":"git+https://github.com/sanity-io/sanity.git","type":"git"},"_npmVersion":"lerna/3.18.3/node@v13.0.1+x64 (linux)","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":"saasen","email":"stensaasanders@gmail.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":"13.0.1","dependencies":{"rxjs":"^6.5.2","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.146.0-alpha.1+f2d2a9378"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.146.0-alpha.1_1574208551349_0.06366425138645604","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.146.0-alpha.1","version":"0.146.0-alpha.1"}