Allow Faker to Take Initial Seed on Construction #3008
Labels
c: feature
Request for new feature
p: 1-normal
Nothing urgent
s: waiting for user interest
Waiting for more users interested in this feature
Milestone
Clear and concise description of the problem
As a developer I want to be able to directly provide a seed when creating a new faker instance. Currently I have to write a separate line mutation the faker instance to configure it the way I want. I feel like it would be good DX to directly create a desired faker instance without having to call additional configuration methods.
Suggested solution
Add
initialSeed
property to the faker constructor, which will set the seed of the internal randomizer instance on creation.Alternative
Make
Faker#seed
chainable and return a reference to the current instance. That way I can at leas write it in a shorter way.Additional context
Same could be argued for
setDefaultRefDate
which could be present as a parameter in Fakers constructor.The text was updated successfully, but these errors were encountered: