-
Notifications
You must be signed in to change notification settings - Fork 88
Conversation
const zeroDomain = isDependent ? [Math.min(...domain, 0), Math.max(... domain, 0)] | ||
: domain; | ||
const min = Collection.containsDates(domain) ? | ||
Helpers.retainDate(Math.min(...domain, 0)) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if all retainDate
does is new Date(val)
why not just do that here? When we were chatting about extracting helper methods I was imagining getMaxValue(arr)
which would do all this date checking and return the correct value type. If you end up going that route, the new methods should be added to util/collection
since they operate on arrays. I thought this would be happening in may more places though, so if you just want to swap out retainDate(val)
for new Date(val)
that's fine too
@boygirl got it, that makes sense. when I was actually implementing it I wondered about that. I'll modify the method but keep it external so that we can more easily add it to other/future methods if need be. |
@boygirl updated - also, tests run fine in the terminal |
@boygirl yayyy tests pass |
update some domain methods in order to fix FormidableLabs/victory#139
supported by FormidableLabs/victory-core#90
@boygirl