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

Introduce merge(Object), drop compose #26

Open
gaku-sei opened this issue Jul 30, 2019 · 0 comments
Open

Introduce merge(Object), drop compose #26

gaku-sei opened this issue Jul 30, 2019 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@gaku-sei
Copy link
Owner

The only use case (so far) for the compose decoder is two merged object decoders. It leads to this kind of code:

const decoder = compose(
  object({ foo: bool, bar: str }),
  object({ baz: num }),
);

The main problem here, is that compose will assume that the object decoder will preserve the provided object as is. But the object decoder should probably filter out the "unwanted" attributes.

Changing the behavior of object and dropping compose should be performed in the same PR.

@gaku-sei gaku-sei added enhancement New feature or request question Further information is requested labels Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant