Skip to content 

IChannelFactory Interface

Packages > @fluidframework/datastore-definitions > IChannelFactory

Definitions of a channel factory. Factories follow a common model but enable custom behavior.

Signature:

export interface IChannelFactory 

Properties

List of properties of this interface
Property Type Description
attributes IChannelAttributes Attributes of the channel.
type string String representing the type of the factory.

Methods

List of methods of this class
Method Description
create(runtime, id) Creates a local version of the channel. Calling attach on the object later will insert it into the object stream.
load(runtime, id, services, branchId, channelAttributes) Loads the given channel. This call is only ever invoked internally as the only thing that is ever directly loaded is the document itself. Load will then only be called on documents that were created and added to a channel.

Events

attributes

Attributes of the channel.

Signature:

readonly attributes: IChannelAttributes;

type

String representing the type of the factory.

Signature:

readonly type: string;

Methods

create

Creates a local version of the channel. Calling attach on the object later will insert it into the object stream.

Signature:

create(runtime: IFluidDataStoreRuntime, id: string): IChannel;

Parameters

List of parameters
Parameter Type Description
runtime IFluidDataStoreRuntime The runtime the new object will be associated with
id string The unique ID of the new object

Returns:

IChannel

The newly created object.

load

Loads the given channel. This call is only ever invoked internally as the only thing that is ever directly loaded is the document itself. Load will then only be called on documents that were created and added to a channel.

Signature:

load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, branchId: string | undefined, channelAttributes: Readonly<IChannelAttributes>): Promise<IChannel>;

Parameters

List of parameters
Parameter Type Description
runtime IFluidDataStoreRuntime Data store runtime containing state/info/helper methods about the data store.
id string ID of the channel.
services IChannelServices Services to read objects at a given path using the delta connection.
branchId string | undefined The branch ID.
channelAttributes Readonly<IChannelAttributes> The attributes for the the channel to be loaded.

Returns:

Promise<IChannel>

The loaded object