fp-like isPast, isToday, etc implementation #2321
-
I noticed that the fp library doesn't expose any functions that use e.g.
consider the fn
currently, we have to mock out if we have the ability to inject
and then hardcode the current time in our test
i find this is a really great pattern for working around the concept of now with date functions and would love to see it supported by the lib, but i get that it represents a bit of a paradigm shift.. any way figured i'd suggest it. eager to hear your thoughts! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey! We have such a function. It's |
Beta Was this translation helpful? Give feedback.
Hey! We have such a function. It's
isSameDay
😉 I think usingisPast(now, date)
in FP code is just confusing. Unless you have better reasons, I would like to keep it as is and recommend useisSameDay
(and other FP-friendly alternatives).