Fork me on GitHub
#clojurescript
<
2019-09-02
>
danielneal14:09:31

I’ve got a couple of decimal objects created via decimal.js-light

danielneal14:09:48

They compare equal with (.equals a b) but not with (= a b)

danielneal14:09:10

is there anyway I can make the extend the cljs equality to these objects?

purrgrammer14:09:16

there is IEquiv for equality and IComparable for comparison (ordering)

danielneal14:09:39

awesome thanks

danielneal14:09:50

was suprisingly difficult to search for

martinklepsch16:09:23

How much am I foot-gunning myself by monkey patching https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp to support .getTime? It’s really annoying that these objects do not support .getTime

martinklepsch17:09:58

@U04V4KLKC because it forces me to handle these dates separately from native dates. The other alternative is to prepare the data containing those dates but I kind of wanted to avoid that

dazld17:09:54

It’ll be fine until it isn’t :)

dazld17:09:11

Think you got all the places where it makes those objects?

dazld17:09:09

not sure what your code looks like, but a helper function might be a bit less fragile