-
Notifications
You must be signed in to change notification settings - Fork 65
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
Support trait for signal #31
Comments
Another Scenario: you want to throttle results (eg for a search input, typically you pause new searches until there is a pause in typing), so you use the second parameter to gate the signal getting through. |
BTW @anuoua, you might want to check out this for nested object signaling: |
This is intentionally unsupported, as it limits the possibility of early returns during comparison. Here are a workaround to do it: computed(prevValue => {
const newValue = yourGetter();
if (yourEqualsMethod(prevValue, newValue)) {
return prevValue;
}
return newValue;
}); To keep the implementation minimal we will not implement the proposal API in alien-signals, but you can track: proposal-signals/signal-polyfill#44 |
Like the new js signal proposal, the equals function is passed in the second parameter to determine whether the object has changed.
Scenario: Many times we encounter persistent instances, their references never change, but their properties do. The signal is never perceived.
The text was updated successfully, but these errors were encountered: