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

Type changes checks to prevent dissoc accidents? #30

Closed
jeroenvandijk opened this issue Apr 30, 2015 · 1 comment
Closed

Type changes checks to prevent dissoc accidents? #30

jeroenvandijk opened this issue Apr 30, 2015 · 1 comment

Comments

@jeroenvandijk
Copy link

Hi Stuart,

Thanks for this library, the concept and the library itself have been of great help to us.

As mentioned by README dissoc shouldn't be used on component records as it will change the record into a map. It is easy to forget to tell this to new component users or just to forget it in general though. This results in very unexpected results sometimes. As far as I know a component should never "change" types during a start/stop cycle. Do you think it would make sense to add assertions for unexpected type changes after stop and start? This would catch the dissoc accidents I believe.

Cheers,
Jeroen

@stuartsierra
Copy link
Collaborator

I have never had any reason for a component to change its type after start, but there is nothing about 'component' which depends on this. It is possible that someone will come up with a use case for component records that return different types from start. It would be an artificial limitation on the power of 'component' to forbid this.

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

1 participant