Skip to main content
Version: v2

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​

ParameterDefaultDescription
Tany

Methods​

MethodAlertsReturn TypeDescription
add(value)BetaanyAdds a value to the collection
remove()BetaTRetrieves a value from the collection.
size()BetanumberReturn the size of the collection

Method Details​

add​

Adds a value to the collection

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

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

Signature​

add(value: T): any;

Parameters​

ParameterTypeDescription
valueT

Returns​

Return type: any

remove​

Retrieves a value from the collection.

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

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 for existing users, but is not recommended for new users.

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

Signature​

size(): number;

Returns​

Return type: number