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

questions for docs #1

Open
xenoterracide opened this issue Nov 28, 2022 · 1 comment
Open

questions for docs #1

xenoterracide opened this issue Nov 28, 2022 · 1 comment

Comments

@xenoterracide
Copy link

is the result of with immutable? and if I call with on the same field a second time will the new value replace the old? how does this work with deeply nested objects/arrays? what if I don't have a no-args constructor?

I think it's worth addressing these in the documentation

@TbotaPhantA
Copy link
Member

TbotaPhantA commented Nov 29, 2022

with mutates any fields and replaces the old value with new one. For example if user name was 'John' and you write .with({ name: 'Jim' }) It will replace the old value with new one.

If you don't have an empty constructor it's not a problem. You create your object however you want and mutate its fields using with method.

I'll put it in documentation later, thanks.

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

No branches or pull requests

2 participants