question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove isSaving/isLoading and replace by isCreating/isRemoving...

See original GitHub issue

Proposal:

  • 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 on isFinding || isGetting

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
eddyystopcommented, Dec 30, 2017

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.

0reactions
amaurymcommented, Dec 30, 2017

Would it make sense to remove isSaving/isLoading after #39?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found