Remove isSaving/isLoading and replace by isCreating/isRemoving...
See original GitHub issueProposal:
- Remove isSaving, isLoading and isFinished
- Replace by isCreating, isGetting, isFinding, isPatching, isUpdating and isRemoving…
Motivation
I often do the following, in my React component, to do something when a resource has been loaded.
componentWillReceiveProps(nextProps) {
if (this.props.feathersUsers.isLoading && !nextProps.feathersUsers.isLoading) {
// Do something when feathers finishes loading users
}
}
However I wish to differentiate the behavior after patching a user or removing a user
componentWillReceiveProps(nextProps) {
if (this.props.feathersUsers.isSaving && !nextProps.feathersUsers.isSaving) {
// How do we know if we patched, updated or removed a user?
}
}
Benefits
- Would follow the feathers way of having find/get/create/patch/update/remove for each service
- Would allow more fine-tuning (see Motivation)
- Users can always get
isLoading
with a selector onisFinding || isGetting
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Quite possibly. Such a change should have a major semver change.
I plan to get my mind back into this repo in Feb once I finish some other Feathers work.
Would it make sense to remove isSaving/isLoading after #39?