reselect icon indicating copy to clipboard operation
reselect copied to clipboard

feat: createStructuredSelector returns OutputSelector

Open stropho opened this issue 3 years ago • 2 comments

Hi, unlike createSelector that returns OutputSelector, the createStructuredSelector currently returns a Selector. What is the difference? OutputSelector is extended Selector and additionally, it includes:

  resultFunc: C;
  recomputations: () => number;
  resetRecomputations: () => number;

Those are great for testing purposes. These attributes are obviously there, but it is a bit awkward to access them in TS project. The resultFunc accepts the the input selectors in somewhat unknown order, because Object.keys does not guarantee to return the same values in the same order in all environments. Thus the arguments of resultFunc in this PR are just any. Nonetheless e.g. recomputations are easily accessible.

stropho avatar Jun 11 '21 14:06 stropho

Still useful, but the PR is stale vs master, and the latest types are... tricky to say the least.

markerikson avatar Oct 20 '21 01:10 markerikson

Thx for the note. I wouldn't notice the change on master after quite a long time :)

stropho avatar Nov 04 '21 13:11 stropho