-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[micro-dash] throttle's performance.now()
not available in React Native
#31
Comments
Interesting. I haven't used react native. What is its philosophy on providing things that a JS developer is used to? Matching some specs? Some specific browser or node environments? (Almost) all the browsers seem to have it: https://caniuse.com/?search=performance.now Is there a resource to see what react native provides? Or does it depend on the device/environment? |
That's a really good question. Probably anything EcmaScript (https://262.ecma-international.org/5.1/) is safe. https://reactnative.dev/docs/javascript-environment Definitely nothing DOM. Some Some environments such as Electron do extend to expose Node-like modules such as In any case, |
I tried turning off "dom" types to see how much of microdash would break. Only throttle and debounce! However, it shows that The other way I could see going is to say "micro-dash assumes a DOM", and expect polyfills when running in other environments. Still thinking about this. Philosophically. :) |
performance.now()
not available in React Nativeperformance.now()
not available in React Native
Interesting thought on the polyfill, I will see if that works. Maybe I can do |
It has been a while, but I'm just looking back through issues. Any luck with the polyfill? Should I close this issue out or revisit? :) |
I’d suggest it’s worth revisiting. Unfortunately I’ve moved on for the time being, but the issue is still valid imho :) |
Just FYI, I think
+new Date()
would be more compatible.The text was updated successfully, but these errors were encountered: