Skip to content

API reference / @chanx-js/client / solid / createChannel

Function: createChannel() ​

ts
function createChannel<D>(descriptor, options?): ChannelResult<ToServerOf<D>, ToClientOf<D>>;

Defined in: packages/client/src/solid/index.ts:76

Open (or join) a channel for the lifetime of the current owner.

Cleanup registers with onCleanup when there is an owner; outside one, call close(). Nothing connects during server rendering. Options are read once: for new params, create it again (inside createMemo or a keyed <Show>).

Type Parameters ​

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

Parameters ​

ParameterType
descriptorD
optionsControllerOptions<AddressOf<D>, ToClientOf<D>> & object

Returns ​

ChannelResult<ToServerOf<D>, ToClientOf<D>>

MIT licensed