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

Add ability to refresh() a single or array of prop rather than all props #3

Open
billneff79 opened this issue Jun 6, 2017 · 3 comments

Comments

@billneff79
Copy link
Contributor

The current refresh() method refreshes all props, which could be quite inefficient if there are many wired up and you only need a subset of them refreshed. Would be useful if it could handle something like refresh('prop1') or refresh(['prop1', 'prop2'])

@pl12133
Copy link

pl12133 commented Jun 7, 2017

Maybe we could mimic pending and rejected here and have refresh be an object with properties for each prop:

this.props.refresh.prop1();
this.props.refresh.prop2();

// How to refresh all?
this.props.refresh['*']();
this.props.refresh.all();

@developit
Copy link
Contributor

Only issue I have there is that it's more surface area we'd have to generate. My inclination is towards keeping things as simple as possible here - just an optional prop name (singular).

@pl12133
Copy link

pl12133 commented Aug 21, 2017

I think I like the solution of refresh accepting a comma separated String or Array of String for refreshing given props the most:

this.props.refresh('username'); // Refreshes only the `username` prop.

this.props.refresh([ 'username', 'foo' ]); // Refreshes both the `username` and `foo` props.
this.props.refresh('username,foo'); // Same as above, using comma separated values instead of Array.

this.props.refresh(); // Refreshes all props

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

No branches or pull requests

3 participants