Skip to content

API reference / @chanx-js/client / core / createChannelController

Function: createChannelController() ​

ts
function createChannelController<D>(
   client, 
   descriptor, 
   initialOptions?
): ChannelController<ToServerOf<D>, ToClientOf<D>>;

Defined in: packages/client/src/core/controller.ts:124

Everything a framework binding needs, with no framework in it.

Bindings adapt subscribe/getSnapshot to their own reactivity and call start/stop on mount and unmount. Keeping the behaviour here means buffering, filtering and batching work identically in React, Vue, Svelte and Solid, and can be tested once without mounting anything.

Type Parameters ​

Type Parameter
D extends ChannelDescriptor<any, any, any, any>

Parameters ​

ParameterType
clientChanxClient
descriptorD
initialOptionsControllerOptions<AddressOf<D>, ToClientOf<D>>

Returns ​

ChannelController<ToServerOf<D>, ToClientOf<D>>

MIT licensed