raveclassic/frp-ts

Unstable default clock

Closed this issue · 1 comments

Hey @raveclassic!

I've noticed that there possibility of data loss since default clock is always incrementing inner value either it's overflows or not:

now: () => ++time,

While it's pretty uncommon to have such a large amount of updates it is still preferable to have handling logic of big numbers.

Hey @Nedgeva, thanks for the issue.
number type is quite wide, assuming we tick every millisecond (Number.MAX_SAFE_INTEGER / 1000 / 60 / 60 / 24 / 365), we'll have about 285616 years to wait for the overflow :D
I think it's not worth adding any checks that would hurt performance here.