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

best practices question #18

Open
jspaaks opened this issue Aug 13, 2018 · 0 comments
Open

best practices question #18

jspaaks opened this issue Aug 13, 2018 · 0 comments
Labels
question Further information is requested

Comments

@jspaaks
Copy link
Member

jspaaks commented Aug 13, 2018

suppose you have a top level component App that maintains the app's data, and a nested component Author that receives information from the top level through its props. Then oninput, it generates an event that notifies the top level component that it needs to change its data.

Currently the handler must know about the top level data structure, e.g. https://github.com/jspaaks/cff-initializer-javascript/blob/d5d53e9a362a250998baf10e0a197b159c92c937/src/AuthorHandler.js#L2-L7
which seems to violate the separation into components.

Would it makes sense to make the AuthorHandler method part of the message payload? It would need to take an input argument authors, and then the methods in App should just be a specification of which authors the method from the message payload should be applied to.

@jspaaks jspaaks added the question Further information is requested label Aug 13, 2018
@jspaaks jspaaks self-assigned this Aug 13, 2018
@jspaaks jspaaks removed their assignment Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant