Published
Edited
May 19, 2020
Insert cell
Insert cell
Insert cell
resRead = {
const variables = { channel, name: "toto" };
const opts = { fetchPolicy: 'network-only' };
return await b.actions.read({ client, variables, opts, raw: false });
}
Insert cell
Insert cell
resReadyHisto = {
const variables = { channel, name: 'toto', n: 10, start: 0 };
const opts = { fetchPolicy: 'no-cache' };
return await b.actions.readHisto({ client, variables, opts, raw: false });
}
Insert cell
Insert cell
resWrite = {
const value = 123;
const variables = {
channel,
name: 'titi',
add_histo: true,
expiry: 20,
value
};
const opts = { fetchPolicy: 'no-cache' };
return await b.actions.write({ client, variables, opts, raw: false });
}
Insert cell
Insert cell
resPublish = {
const value = JSON.stringify({ a: 569, b: 'azerty' });
// const value = 1234;
const variables = {
channel,
name: 'titi2',
value
};
const opts = { fetchPolicy: 'no-cache' };
return await b.actions.publish({ client, variables, opts, raw: false });
}
Insert cell
Insert cell
resPublishWrite = {
const value = 1234;
const variables = {
channel,
name: 'titi',
add_histo: true,
expiry: 20,
value
};
const opts = { fetchPolicy: 'no-cache' };
return await b.actions.publishWrite({ client, variables, opts, raw: false });
}
Insert cell
Insert cell
lastValue = latest && latest.value
Insert cell
latest
Insert cell
Insert cell
// synced
Insert cell
Insert cell
synced = {
const params = {
client,
channel,
pattern: false,
maxDuration: 3000,
filter: name => true
};
return buildSubscription(params);
}
Insert cell
Insert cell
Insert cell
Insert cell
// handler.remove('08_08_53_653')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more