-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
breaking changeCannot be merged when next version is not a major releaseCannot be merged when next version is not a major releasec: refactorPR that affects the runtime behavior, but doesn't add new features or fixes bugsPR that affects the runtime behavior, but doesn't add new features or fixes bugs
Milestone
Description
Clear and concise description of the problem
Currently we need to bind this
in the constructor of each module to support stuff like
const color = faker.color
color.rgb()
// and
const rgb = faker.color.rgb
rgb()
Suggested solution
Instead of using js classes we could instead use wrapped functions like e.g. composables are working in Vue / VueUse
Alternative
No response
Additional context
This might be a breaking change as with that you would not create a new class via new Faker(...)
anymore
Also we need to benchmark if there would be performance regressions or benefits 🤔
I would like to setup a PR if this proposal gets accepted by the team
ST-DDT
Metadata
Metadata
Assignees
Labels
breaking changeCannot be merged when next version is not a major releaseCannot be merged when next version is not a major releasec: refactorPR that affects the runtime behavior, but doesn't add new features or fixes bugsPR that affects the runtime behavior, but doesn't add new features or fixes bugs