Skip to content

LoroList indexOf #847

@sunnyawake5

Description

@sunnyawake5

hi,
i want to insert a new LoroMap into LoroList:

// insert a new item after another item
let current=xxx
let index=list.indexOf(current)
let newItem=list.insertContainer(index+1,new LoroMap())

how to get index of an item from a LoroList?

or it's safer to call something like this( currently no suck api):
let newItem=list.insertContainerAfter(item,new LoroMap())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions