Skeudenn / lib/reading-time / ReadingTimeAccumulator
Interface: ReadingTimeAccumulator ​
Defined in: src/lib/reading-time.ts:7
Collects reading seconds and hands them over in batches.
Methods ​
flush() ​
flush():
void
Defined in: src/lib/reading-time.ts:11
Sends what is pending, however short (the reader is closing or the window was hidden).
Returns ​
void
tick() ​
tick(
active,seconds):void
Defined in: src/lib/reading-time.ts:9
Adds seconds when active (the book is open and the window in use); sends the batch once it is long enough.
Parameters ​
active ​
boolean
seconds ​
number
Returns ​
void