{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"a275750a002f176c81e846e2423736466a9ee7ee","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.139.0-rc.0.tgz","fileCount":21,"integrity":"sha512-BefofL744YOct0lAYA6yLzl+B3vmpvVEgu53CrIhVinCu4+MwuIU4jyJrldqe4l42ALdxhp7LshXGOv/F1KuIw==","signatures":[{"sig":"MEUCIGoV9cTs4dles2yXpEJaN/DLxz5dyf1di6JbOEr/pqfNAiEApNtAZ9lNw+FEFMNOsrFajchyc9ThdGUKPSc+Inkg21I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGO5BCRA9TVsSAnZWagAAw5cP+gMgX38NwdpecnQgPhRS\nl2S3B7Z3mEuuudJS58E/BA1OlUJi3IqlfPZ26oZA2JOv9VTHDcNbUCGWccVx\nJ7A99pN252swEkv5JSZK1Mg8mylpnhX0Vz29S0v1jMHXtn3kJEi0SdB52RH9\n7Pn4arPnrW30aIH/s53br1IpoO1U5llontzR8aK7Rr59QBK+k9/7YctYjlp4\nnk7oVeBkmSRoIIjVBK4c6k0Pg9DmBzR/CpSHEsMnNIoSerCwG4ZP1iX9eRl/\nvBwPA4hSey55aYR64c9IeMssAkya3L0d8Jvlk8YCXA2ueJrVEBpWExiQgGWu\nH8mcQqNgc3fTV+d7R74Z+2laHtbK+16810fd01AveCJArycUyUFfmF6LmYOz\nGSHFRP1er10kIuRtspkteXcC91rqijS23V3I0TffPDVEW7bj7OW894nAMuHm\nj7NjylKETFdIBsm4nDJXd05Snzz36pQMU8voa0LNc0Xw7jXxkKDqFxLA8Nsz\ngslgLAtXHnBf5ROaPsTI8XgKMk7RqEZ+iSXoEz9VV7HuRkLUCGGB1C6NrhMe\n/TiSEK3aixNCRoOh34GzJqJiCw8sXsJAtc8m1giO/xm0X9sPJWVCLAS+9BTZ\ngyeyB8qE9F7B6OTBEoJWMbxiTzTGKiXJ+gmFL6ceoqHvlK7G9U1hjNZJoafp\n9r6c\r\n=Npqv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","_from":"file:sanity-document-store-0.139.0-rc.0.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":"bf608b9d321e341f90350083ea9557bd9f37c1d6","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"],"_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":"8.12.0","dependencies":{"rxjs":"^6.1.0","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.139.0-rc.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.139.0-rc.0_1545137728514_0.4786753875698062","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.139.0-rc.0","version":"0.139.0-rc.0"}