Closed ryanturnerwebdev closed 7 years ago
Oh wow, this is my mistake—I thought this was an ES5 feature. Thanks for catching this.
This is really helpful having another person with eyes on this!
You're 💯 with removing the comments; I ended up with:
export const polyfill = x => (x > 0) - (x < 0) || +x
export const mathSign = Math.sign || polyfill
I’ll patch to beta.21
shortly.
Haha, yeah the comments were a bit excessive for a relatively simple function weren't they. Good to see the changes are making into beta.21 though; Cheers matey.
Saw this throwing an error on Safari 8 when doing some cross browser test and found out that compatibility for Math.sign isn't the best so have used the provided polyfill.
Could remove the comments if you wanted to keep the bundle as lean as possible? Else you could add it to the delegate function file if not being used anywhere else as it is essentially one line of code!