Skip to content

Evaluate option to provide keySelector with same args as resultFunc #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
toomuchdesign opened this issue Aug 28, 2019 · 1 comment

Comments

@toomuchdesign
Copy link
Owner

toomuchdesign commented Aug 28, 2019

A lot of users stumbled upon the question of which arguments are actually provided to keySelector function.

Currently, keySelector functions receive the same arguments as the inputSelectors and the selector itself, but it's easy to mistakenly think that they receive same arguments as resultFunc (which are the result of inputSelectors), instead.

See these threads:

Given that this problem could be alleviated with a better documentation, I'd like to understand pros and cons of adding an option to provide keySelectors with resultFunc results as proposed here by @mbellman.

@toomuchdesign toomuchdesign changed the title Evaluate option to provide keySelector with inputSelectors results Evaluate option to provide keySelector with resultFunc results Aug 28, 2019
@toomuchdesign toomuchdesign changed the title Evaluate option to provide keySelector with resultFunc results Evaluate option to provide keySelector with same args as resultFunc Aug 29, 2019
@landisdesign
Copy link

landisdesign commented Aug 1, 2021

It feels to me like a question of how the caching scheme would be made apparent to the end user of the selector. If I create a selector and I want others to use it, it should be fairly intuitive to understand how it's cached. How would I explain what impacts the cache of the selector?

As it stands now, the end user of the selector could be told, "This selector caches on objectId as long as state doesn't change." How would that sentence look if we need to explain the intricacies of how we got our resultFunc arguments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants