{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"71a9c8685372e4d1184bbc816d0a5eef98d0f70a","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.142.8-initial-value-templates.64.tgz","fileCount":21,"integrity":"sha512-yJkcCh3IKRDrAb2OceiOTosOCrWT/UAikiW89dIFcNZE6QEOJZ574rHdMvhO3NlZ3pl1K6cnKauEW9wrGd2ovg==","signatures":[{"sig":"MEYCIQCKd2OEt5ALkLcSbl2bZmov/w1tnju95BI3g+p9NBWwBQIhAPUmBQscoiJyt78J5RDcIUKZH11DWj+pzm1hSUYJYdW0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqe/oCRA9TVsSAnZWagAAUJwP/iK6kBLULLk9NUu0a1aM\n3ejl67Ar7BgWo21q9m/hSnyhAqoO6mJ2kyt21fTCPMzno3z+n1VWApNaqQc9\neAEsD0oBhL99LyZmvAhkAp3vcefCtI/8hvEMqGg5hh4mudNliPBudYu5KFMg\nlC7dpuM8GsRxAJUhCwU+rJ3216OaPa1oO2jIOrPgRFyZrDFQHSusZIrJIPR7\nrzHLJVKS6UujVP97cOUqym7PKEIGR8XeGQQMccwVGwvNljWthqPl12WsJFZg\n6UpPAx75lzT3fVQuvhM37ctWaW43n/OInJkH8HAfLPgHzcWEzNphtADFw3R3\nPmlERSF1JDaLXLlyIDJf0WEBw0fOb94Dg6FcyQCJ0o0llk0Yf6BrtCNF2noE\njJPEpeYk5N2ghUC2B+MwdpGlrpv57+0i5kXzK6xC5NSnao7XidslWWSa0iv+\nW9r7iDBz3j4pvYCsEHVpRy2wyj4/4fEk+VC1uEql56E8FYJoTjgS6EeBWaiR\nptgn4DK7pA2BHWsUHd0w9t4qlgFl//SyXZvBzviEHqLuPzFo7vOYUWk/C0ny\nZfx0Y+dvrCpufiTHSLuoY/pBo2omVsjx1ZgQ3t2lyDcG3uJO6MDeKicQugcG\ndRfsu4s8O0c/jibMEKBk/MQ6epZyKvoSX1B+enBBI2FS6OJRcdSeAJd3TLIj\n87vc\r\n=q2p6\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":"5787b877b775b071d5ea05579f5dd3a5950b32c3","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":"rexxars","email":"espen@hovlandsdal.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.16.4/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":"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":"10.15.3","dependencies":{"rxjs":"^6.5.2","lodash":"^4.17.4","nano-pubsub":"^1.0.2","@sanity/mutator":"0.142.8-initial-value-templates.64+5787b877b"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.142.8-initial-value-templates.64_1571418087895_0.9631872832144357","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.142.8-initial-value-templates.64","version":"0.142.8-initial-value-templates.64"}