Skip to content

ko.observableArray-like helper? #15

@WorldMaker

Description

@WorldMaker

childrenBind is intentionally a simplistic, low level tool. Something like ko's foreach binding can be somewhat approximated with:

const childrenBind = arrayObservable.pipe(
  mergeMap(array => from(Array.entries(array))),
  groupBy(([index]) => index),
  map(([, item]) => <SomeComponent item={item} />),
)

But of course this rough guide will have issues with removals from the end of the array and may need some deeper helper anyway. There's some imperative usefulness to ko.observableArray that might be useful to find a way to rebuild either as a childrenBind helper or a childrenBind eventual replacement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions