1.0.11 • Published 11 months ago

reorderer v1.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Reorderer

npm.io

Keep a list ordered upon moving a list item in the list

The API is very straight forward

Usage

const mySortedListOfThings = [
  { initialListIndex: 0, listIndex: 0 }, // `listIndex` is the only required field for `reorderer` to work
  { initialListIndex: 1, listIndex: 1 },
  { initialListIndex: 2, listIndex: 2 },
  { initialListIndex: 3, listIndex: 3 },
]

const { reorderedList } = reorderer({
  sortedList: mySortedListOfThings,
  fromListIndex: 0,
  toListIndex: 2,
})

console.log(reorderedList)
// [
//   { initialListIndex: 1, listIndex: 0 },
//   { initialListIndex: 2, listIndex: 1 },
//   { initialListIndex: 0, listIndex: 2 },
//   { initialListIndex: 3, listIndex: 3 },
// ]
1.0.11-2b056a0.0

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.9-aa14c45.0

11 months ago

1.0.9-d39a467.0

11 months ago

1.0.9-30134fe.0

11 months ago

1.0.9-c47a83f.0

11 months ago

1.0.9-73138b1.0

11 months ago

1.0.11-3ff5e21.0

11 months ago

1.0.9-bdbf779.0

11 months ago

1.0.9-81ad8a2.0

11 months ago

1.0.11-56dd477.0

11 months ago

1.0.9-f50712f.0

11 months ago

1.0.9-91a56ad.0

11 months ago

1.0.9-5b6c1f5.0

11 months ago

1.0.12-f7430e5.0

11 months ago

1.0.11-b1deb19.0

11 months ago

1.0.9-b364ddb.0

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago