Skip to main content

IOrderedCollection Interface

Ordered Collection interface

Collection of objects that has deterministic add and remove ordering. Object implementing this interface can be used as the data backing for the ConsensusOrderedCollection

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/ordered-collection/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IOrderedCollection<T = any> extends ISnapshotable<T>

Extends: ISnapshotable<T>

Type Parameters

Parameter Default Description
T any

Methods

Method Alerts Return Type Description
add(value) Alpha any Adds a value to the collection
remove() Alpha T Retrieves a value from the collection.
size() Alpha number Return the size of the collection

Method Details

add

Adds a value to the collection

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/ordered-collection/alpha.

For more information about our API support guarantees, see here.

Signature

add(value: T): any;

Parameters

Parameter Type Description
value T

Returns

Return type: any

remove

Retrieves a value from the collection.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/ordered-collection/alpha.

For more information about our API support guarantees, see here.

Signature

remove(): T;

Returns

Return type: T

size

Return the size of the collection

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/ordered-collection/alpha.

For more information about our API support guarantees, see here.

Signature

size(): number;

Returns

Return type: number