Closed etc-tiago closed 4 years ago
While it might be good to use something less confusing than new Date()
(i.e. Date.now()
), it is perfectly valid to do subtraction math on Date
instances because they implement @@toPrimitive
. See “Why can I do math with Date objects?” on Stack Overflow.
Thanks for the concern though, and looking over the details! Maybe we can tweak it to be less confusing :)
The date object cannot be subtracted
this https://github.com/jaydenseric/graphql-react/blob/84509154cb6ed72ea1d571f0355bedc2626281cc/src/universal/useGraphQL.js#L205
should be