[Feature Request]: export an instantiated chance object
See original GitHub issueCurrent Behavior
Currently we have a lot of boilerplate code and a lot of instantiated chance objects in our test files:
import Chance from 'chance';
const chance = new Chance();
Expected Behavior
Provide an instantiated chance object to consumer:
import {chance} from 'chance';
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Node Module Exports Explained - freeCodeCamp
The above object basically describes an encapsulated module from a JS file with module.exports being the exported component of any types - ...
Read more >Object Schema Export in Insight Cloud - Atlassian Community
Hi Martin, There is a feature request suggesting implementing this feature on the Cloud version: export all device from insight cloud.
Read more >"export var" for custom types/classes #359 - GitHub
This feature looks logical and it provides the possibility to edit exported custom class variables via the inspector.
Read more >Page-Specific Export - Feature Request? - Ideas - Bootstrap Studio ...
Hi, I am converting / rewriting a website using Bootstrap Studio. The site currently has about 30 pages and is growing. As a...
Read more >Exporting data to a JSON, CSV, or XML file - Zendesk help
If you do not have this feature, contact Zendesk Customer Support to ... For CSV or XML exports, click Request file beside the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
HI! I haven’t quite been sure if I want to submit the PR yet for fix some tests, but would something like this work?
https://github.com/chancejs/chancejs/compare/master...TheLarkInn:feature/rewrite-to-modules?expand=1
See the test changes.
Sorry for the long response, but generally I always envisioned making this the default in 2.x which I also hoped to pair with the code splitting which it seem like may be implemented in @TheLarkInn 's change though I haven’t had time to dig into it in depth yet.
But I’ve always regretted returning the constructor and expecting folks to instantiate it. While that has its upsides (flexibility of seed), it comes with a lot of downsides (PITA having to instantiate which is counter-intuitive and not the way most node modules function in 2018).
Anyway, tentatively feeling good about it, but want to make sure it isn’t a significant breaking change.