Checks if any of the readables have a new value available. If this function returns true, the callback in the current subscription, or a new call to Reader.once is guaranteed to be invoked. The intended use of this method is to cancel rendering of the Mod if there are new values to any of the readables specified when the reader was created.
Read the content once for the readables specified when the reader was created. Any current subscription for this reader will be cancelled.
The callback function that is called once when there is at least one new value to read.
Rest
...values: TOptional
onReadError: ((error: string) => void)Optional callback function that will be called if there are errors reading the readables.
Subscribe to changes in the content for the specified readables when the reader was created.
The callback function that is called every time when there is at least one new value to read. The callback function will not be called until the previous callback function has returned.
Rest
...values: TOptional
onReadError: ((error: string) => void)Optional callback function that will be called if there are errors reading the readables.
Subscribe to changes in the DataView.
let reader = mod.createReader(mod.visualization.data());
reader.subscribe((dataView) => {
console.log(await dataView.rowCount());
});
The reader is responsible for combining multiple Readables and scheduling a callback to be invoked when one or more of the Readables have changed. Choose one of the appropriate methods; Reader.once or Reader.subscribe that suits the needs of the Mod. An instance of the reader is created by calling the Mod.createReader method.