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

Passing job state to the wrapped component #49

Open
oyeanuj opened this issue Nov 30, 2017 · 0 comments
Open

Passing job state to the wrapped component #49

oyeanuj opened this issue Nov 30, 2017 · 0 comments

Comments

@oyeanuj
Copy link

oyeanuj commented Nov 30, 2017

Hi @ctrlplusb, As I was using this library, I ended up making another modificaiton that I thought I'd bring up here incase you think it is helpful to include in the library or is helpful to anyone else.

The components that I had built tend to handle loading states and error states within themselves based on their own custom logic for more finegrained loading and error handling experience. So, I ended up needing the entire jobState passed to the WrappedComponent rather than only the jobResult. This meant, I didn't need to add LoadingComponent/ErrorComponent and instead each component made its own decision (sometimes even child components made decisions for their own sections).

Here is the commit in question: oyeanuj@b1c2c81

Do you think this or similar prop should be part of this library? One clean alternative that would be a breaking change would be to pass the entire job state to the wrapped component always without needing to introduce a new prop to enable it?

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

2 participants