Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom parameter merging behavior #160

Open
pangolingo opened this issue Feb 7, 2025 · 0 comments
Open

Support custom parameter merging behavior #160

pangolingo opened this issue Feb 7, 2025 · 0 comments
Assignees

Comments

@pangolingo
Copy link
Contributor

There are a few issues in this repo reporting problems or unexpected behavior related to how parameters are merged into factories. Under the hood Fishery uses a deep-merge behavior. It uses mergeWith from Lodash and adding some customizations to the merge behavior (explicit undefined will override params instead of being ignored). It also does some fancy Typescript typing to explain how the parameters are deep-merged.

Issues related to parameter merging behavior:

I propose allowing Fishery users to override the default merge behavior with their own merge strategies. This should give more control over merge behavior. Perhaps you could choose from deep merge, shallow merge, or a custom merge. This might also give more control over Typescript types, by specifying the input and output types of the merge function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant