Skip to content

Tankōbon / lib/data-store / applyLibraryChange

Function: applyLibraryChange() ​

applyLibraryChange(entries, change): LibraryEntry[]

Defined in: lib/data-store.ts:59

Applies a LibraryChange that names entries to the library, keeping it ordered by lastOpenedAt, most recent first, like library:list. An entry already there is replaced in place unless its lastOpenedAt changed (the book was just opened), in which case it moves to where that date puts it; a new one goes where its date puts it too. Returns entries itself when nothing changed.

Parameters ​

entries ​

LibraryEntry[]

change ​

LibraryChange

Returns ​

LibraryEntry[]