-
-
Notifications
You must be signed in to change notification settings - Fork 126
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 IComputedOptions in createTransformer #224
Support IComputedOptions in createTransformer #224
Conversation
In the same vain as mobxjs#215, it would be great to use a custom equals function with createTransformer, to avoid bubbling bubbling recomputes of transformers that return arrays. This commit passes the options through to the internal `computed`. The name option is not passed through, since that can be changed with the `debugNameGenerator` option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/create-transformer.ts
Outdated
onCleanup?: (resultObject: B | undefined, sourceObject?: A) => void | ||
debugNameGenerator?: (sourceObject?: A) => string | ||
} | ||
| Exclude<IComputedValueOptions<B>, "name"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be Omit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for seeing that - I've updated the PR.
Hullooo. Is this still going ahead? |
Released as 5.5.3 |
Shouldn't this PR be closed if it was merged and released? :) |
It should! |
In the same vein as #215, it would be great to use a custom equals
function with
createTransformer
, to avoid bubbling bubbling recomputesof transformers that return arrays/maps/etc.
This commit passes the options through to the internal
computed
. Thename option is not passed through, since that can be changed with
the
debugNameGenerator
option.