DataConnections Class
Optional connection manager. Private state is inaccessible at runtime; no global namespace is installed. One provider per logical connection, multiple bindings per query. Re-registering cancels obsolete refreshes. Loading cancels requests and clears bindings; register bindings again for the new document. Dispose on host teardown.
Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.
ES module import: import { DataConnections } from '@txtextcontrol/tx-sheet-control-server';.
Constructor
new DataConnections(workbook)
| Parameter | Type | Optional | Description |
|---|---|---|---|
workbook | DataWorkbook | No | Value matching workbook's declared type and the owning object's validation rules. |
Returns: DataConnections.
Members
Methods
| Method | Description |
|---|---|
| bind | Installs a detached binding. It does not fetch until refresh is called. |
| dispose | Stops polling and cancels all queries. This instance cannot be reused. |
| onChange | Subscribes to lifecycle notifications; returns an unsubscribe function. |
| refresh | Fetches and validates a complete snapshot before writing. Latest refresh wins; failures preserve old data. Errors are returned to the host, which controls user-visible diagnostics. A timeout rejects with AbortError. |
| refreshAll | Refreshes all bindings independently; one rejected source does not prevent the others from updating. |
| register | Registers a transport; replacing it cancels requests using the previous transport. |
| start | Starts nonoverlapping polling, default 30 seconds, with at least one second between completed rounds. |
| stop | Stops polling; manual refreshes remain available. In-flight requests can complete. |
| unbind | Removes a runtime binding and cancels its request. Existing workbook data remains. |
Examples
Pass the DataConnections value obtained from its owning control, collection, callback or operation. The function reads that value without constructing a replacement document object.
function inspectDataConnections(dataConnections) {
const value = dataConnections;
console.log('DataConnections.value', value);
}