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.

Differentiate results

See original GitHub issue

I like the approach of this package and the simplicity on how it works.

Edit I tested a lot and simplified this issue based on my tests:

Please look at following situations to understand my issue:

  • Situation A: I need to find a list of data sets based on different query options. If I wanted to display two lists of data sets on the same page I would need to have two reducers right now in order to distinguish the results and to prevent them from being overwritten.
  • Situation B: I get a data set from the server. I have an error message field which should print a warning if the data could not be fetched. When the data was successfully fetched from the server I want to change it somehow. So I do an update. If the update failed and I now go back to my preview of the data I get an error message which I can’t tell if it was from the get or the update, so I have to add additional state to distinguish.
  • Situation C: I find an array of data sets from my server which give me basic information about my entries. I now want to get each entry of the same endpoint afterwards and load them into my view so that my application doesn’t hang and the user wouldn’t need to wait until all of the data was fetched before he could interact with the UI. How should I get both the result of the find and all results of get into the state?

So here are some possible solutions:

  • Solution for situation A: You could set something like a ‘namespace’ in the action to let the reducer know in which substate the result should be put. This would give the user most control about the data but would cause a lot of substates which may never be reused afterwards. I also don’t think that this would be redux conform as you would modify the way the reducer works in the actions which should be prevented if possible.
services.myService.find/get/...('namespaceA', data);
services.myService.find/get/...('namespaceB', ...);
myService: {
  namespaceA: {
    isError, isLoading, isFinished, data, ...
  },
  namespaceB: {
    isError, ...
  }
}
  • Solution for situation B: You could add a field like ‘method’ to the state.
services.myService.get(...);
myService: {
  method: 'get',
  isError,
  data: { entryData },
  ...
},
  • Solution for situation C: A mechanism to inject the result into queryResult?

Please let me know what you think about this.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
Sicriacommented, Nov 7, 2017

Any update on this? The base functionality is great, but Situation A is really common.

Edit - Ended up using the following, seem to provide the functionality I was after.

export function feathersReduxServices(app) {
  return {
    ...reduxifyServices(app, [
      'users',
      'articles',
    ]),
    ...reduxifyServices(app, { articles: 'topArticles' }),
  };
}
1reaction
eddyystopcommented, Aug 12, 2017

Just want to let you know I’m still thinking about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Differentiated Results - Models Method
One of the first things a business usually tries to do is find a way to differentiate their product or service … What...
Read more >
Q: What is the difference between findings and results? - Editage
Technically or academically speaking, 'findings' seems to be used more for qualitative studies whereas 'results' seems to be used more for ...
Read more >
What's the difference between results and discussion? - Scribbr
The results simply and objectively reports what you found ; the discussion interprets the meaning of the results and explains why they matter....
Read more >
Showing explicit and implicit differentiation give same result
Sal gives an example of how implicit differentiation results in the same derivative expression as direct differentiation. Created by Sal Khan. Sort by:....
Read more >
Differentiation using standard results - YouTube
Differentiation using standard results is an alternative and direct way of finding gradient of a curve. In this video i have made a...
Read more >

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