Comments (4)
Isn't randomUUID a function?
No, in the browser it is not a free static function, but needs to be bound to crypto
:
// works in the browser — does not work in Nodejs
times(crypto.randomUUID.bind(crypto), 5);
Funnily enough, in Nodejs crypto.randomUUID
is a free static function, but your example won't work there either. This is because — if called with an argument — it expects that optional argument to be an object.
You'll get another error message
TypeError: The "options" argument must be of type object. Received type number (0)
It's still an awful mess trying to write isomorphic JavaScript. (Mostly the messy browser apis imo)
Btw. same issues with console.log
😵💫
Supplement:
On the other hand JSON.parse
again is static in the browser.
Who decides that stuff anyway, and why? It's massively annoying for FP: there seems to be no scheme.
from ramda.
Thanks for the detailed answer, I was not aware of a free static function
. What kind of function is crypto.randomUUID
on the browser if it is not a free static function?
from ramda.
What kind of function is
crypto.randomUUID
on the browser if it is not a free static function?
A "method for the crypto
namespace" perhaps?
All I know is that in C++ one calls functions which are provided by objects and operate on their (private) data "methods". In JS that would apply to functions which use this
in their implementation. So perhaps randomUUID
somehow needs this
≡ crypto
to work. 🤔
from ramda.
ty for the explanation @semmel
from ramda.
Related Issues (20)
- R.without broke backwards compatibility on #2603 HOT 1
- update vulnerable dependencies
- update sanctuary
- bug: code coverage failing
- enhancement: update prop to include deeply nested objects
- enhancement: update path to use prop
- Support promises for pipe and pipeWith HOT 2
- `groupBy` throws inscrutable errors when inferred to be a transducer HOT 4
- Incorrectly implementation of the 'unless' function HOT 1
- TypeScript fails compilation on reduce currying HOT 1
- Add minify to partial build HOT 1
- 0.30.0 upgrade guide HOT 3
- Is there a problem with curryN? HOT 3
- Deno.land releases have stopped ~3 years ago HOT 7
- Since v0.30 functions curried by Ramda break when used with `R.__` from another Ramda version HOT 1
- Consider Major Version Update For Breaking Changes HOT 6
- 0.30.0 `propEq` is wrong
- 0.30.0 @types/ramda lensProp HOT 1
- 0.30.1 upgrade guide
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ramda.