Skip to content

accept strings in Automerge.Text.insertAt #326

Open
@josharian

Description

I sometimes have to do bulk inserts into an Automerge.Text, e.g. when importing a new document.

The current API accepts inserts one character at a time: text.insertAt(0, 'h', 'e', 'l', 'l', 'o'). Doing this with bulk inserts I've hit the javascript limit on the number of arguments allowed to a function call (65536).

I'd like it if insertAt also accepted strings and treated them indistinguishably from individual characters: text.insertAt(0, 'hello') (and maybe text.insertAt(0, 'he', 'llo'), not sure).

Or alternatively, a new API that accepted only one single string: text.insertStringAt(0, 'hello').

I'm willing to attempt an implementation if you're open to it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions