Class Arr<T>
Type Parameters
- T
Hierarchy
- Cell<Elems<T>>
- Arr (View Summary)
Accessors
cells
Returns Elems<T>
length
Element count as a reactive
Num(structural changes only).Returns Num
values
Methods
assertContains
clear
Empty the collection (a view removes only its visible elements).
Returns void
derive
filter
groupBy
indexOf
insert
lens
map
merge
move
moveBefore
Splice
eto just beforeanchor(or to the end whenanchoris null). On a baseArrthis rewrites the reference order; on a view it delegates through the view'smoveBefore, where the sharedanchorcell stays meaningful in the base order. No-op ifeisn't present.Returns void
peek
Returns Elems
push
remove
removeAt
Remove the element at index
iin this (view's) order.Parameters
- i: number
Returns void
sortBy
through
Staticcoerce
Staticderive
StaticfromSource
Staticis
Staticlens
- lens<C extends AnyCellCtor, P>(
this: C,
parent: Read<P>,
fwd: (v: P) => Inner<InstanceType<C>>,
bwd: (target: Inner<InstanceType<C>>, v: P) => P,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[]>(
this: C,
parents: P,
fwd: (vals: ReadValues<P>) => Inner<InstanceType<C>>,
bwd: (
target: Inner<InstanceType<C>>,
vals: ReadValues<P>,
) => BackUpdates<ReadValuesOrSkip<P>>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P, Cm>(
this: C,
parent: Read<P>,
spec: StatefulLensSpec1<P, Inner<InstanceType<C>>, Cm>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P
- Cm
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[], Cm>(
this: C,
parents: P,
spec: StatefulLensSpec<ReadValues<P>, Inner<InstanceType<C>>, Cm>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
- Cm
Returns Writable<InstanceType<C>>
Staticpin
Properties
Readonly_t
Type Declaration
equals: <E>(a: readonly E[], b: readonly E[]) => boolean
name
Optional debug label (cell(0, { name })); used by errors and graph dumps.
Readonlyvalue
Statictraits
Type Declaration
equals: <E>(a: readonly E[], b: readonly E[]) => boolean
The element cells in order; tracked when read in an effect/derive.