Skip to content

Tankōbon / lib/home-picks / pickRandomUnread

Function: pickRandomUnread() ​

pickRandomUnread(library, count?, random?): LibraryEntry[]

Defined in: lib/home-picks.ts:16

Up to count distinct books drawn at random among those not finished yet (see isFinished(); a book already started still counts as unread). Fewer are returned when the library holds fewer. random is injectable for tests and returns a number in [0, 1) like Math.random.

Parameters ​

library ​

readonly LibraryEntry[]

count? ​

number = HOME_PICK_COUNT

random? ​

() => number

Returns ​

LibraryEntry[]