ericclemmons / ericclemmons/react-resolver
Resolve multiple props with one callback
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
I got into this situation where my React component requires more than one prop.
One way to solve it was through adding two `@resolve` calls with two different callbacks.
`@resolve("propA", function() { remoteCall() .... return response.propA; })`
`@resolve("propB", function() { remoteCall().... return response.propB; })`
However, I'd like to be able to collect multiple props in one single callback, and hence save one remote call.
I hacked something together that allows me to do something like:
``` js
@resolve("{propA, propB}", function() {
remoteCall() ...
return { response.propA, response.propB };
})
```
- Does this make sense?
- Is there any other way to do this?
- Does this go against react-resolver's philosophy?
@ericclemmons: I can put together a Pull Request if you think this makes sense.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.