Skip to content

KeyedCollection

[<Class>]
type KeyedCollection<'K, 'V when 'K: equality> =
    member Rows: Projection<'K,'V>
    member AddOrUpdate (value: 'V) : unit
    member Clear () : unit
    member Dispose () : unit
    member Edit (edit: Action<KeyedCollection<'K,'V>>) : unit
    member Remove (key: 'K) : bool
AssemblyRanvier
ImplementsIDisposable

An editable collection with insertion order and separately observable rows.

Owned by the creating scope. Updates use the graph's value equality policy; keys use structural equality.

Properties

member Rows: Projection<'K,'V>

The reactive view used by collection operators and readers.

Methods

member AddOrUpdate (value: 'V) : unit

Adds a new key at the end, or updates its existing row without changing its position.

member Clear () : unit

Removes every key.

member Dispose () : unit

Disposes the rows and resets existing readers to empty. Idempotent.

member Edit (edit: Action<KeyedCollection<'K,'V>>) : unit

Batches the synchronous edits made by the callback.

Applied edits survive a throwing callback. This operation does not roll back or span asynchronous work.

member Remove (key: 'K) : bool

Removes the key. Returns false when it is absent.