Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 877 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 877 Bytes

Fractional Indexing

Nuget

This is based on JS implementation by rocicorp which in turn is based on Implementing Fractional Indexing by David Greenspan .

Use it to generate short string keys which help maintain ordered lists.

For example when reordering to-do items, drag and dropping between items, or as last / first one.

Usage

var key1 = OrderKeyGenerator.GenerateKeyBetween(null, null); // to get started
var key2 = OrderKeyGenerator.GenerateKeyBetween(key1, null); // after key1
var key3 = OrderKeyGenerator.GenerateKeyBetween(key1, key2); // between key1 and key2
var key0 = OrderKeyGenerator.GenerateKeyBetween(null, key1); // first one