Cloud Client Intro
The cloud client provides an in-memory representation of a domain's data within a source. The client helps you observe and optimistically change data within the source.
It requires a source upon creation:
import createMemoryStorageSource from "@aven-cloud/cloud/createMemoryStorageSource";
import createCloudClient from "@aven-cloud/cloud/createCloudClient";
const source = createMemoryStorageSource({
domain: 'mydomain',
});
const cloud = createCloudClient({
source,
domain: 'mydomain',
});
Because the client is the primary interface to our storage, we tend call it "cloud"
Getting Docs
You can call `.get` on a client to access docs within it:
const foo = cloud.get('foo');
// Access the doc named "bar" under the parent doc "foo":
const fooBar = cloud.get('foo/bar');
You can also call `.get` on the doc, to access a child:
const alsoFooBar = foo.get('foo');
// fooBar === alsoFooBar
API
Cloud Client - The entry point for the client API
Cloud Doc - The mutable client-side entity
Cloud Block - The immutable client-side entity
Cloud Values - Additional methods available on Docs and Clients