-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
Description
Currently, methods that expose random behaviour, like sample, use the internal Math.random() function, which is unseeded. Not being able to optionally enforce deterministic behaviour in a functional setting is... odd. I would like to suggest the discussion over possible enhancements and alternatives to implement such feature, amongst which:
- Change all internal function call of
Math.random()to a lodash random number generator; - Make this random number generator a... generator function;
- Support passing an extra parameter in functions like
sampleto set the seed; - Support an optional callback in functions like
samplethat provides a generator; - Get an objective measurement on the performance impact of such changes, and aim for a zero-cost abstraction so we don't end up with angry people.
carlsmith, cxw42, stefanuddenberg, breck7, elamperti and 16 more