@mocanvas/store · function

getIndexBetween

declare function getIndexBetween(below?: IndexKey | undefined, above?: IndexKey | undefined): IndexKey

Generate a key strictly between below and above; either may be omitted. Throws when below >= above.

Jittered — see the note above JITTER_DIGITS. Two calls with the same arguments return *different* keys, both in the same gap, which is what lets two clients insert at one position without one of them being merged away.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.