-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(usestore): use selector to replace depActions #161
Conversation
Codecov Report
@@ Coverage Diff @@
## master #161 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 296 317 +21
Branches 70 80 +10
=========================================
+ Hits 296 317 +21
Continue to review full report at Codecov.
|
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.
done
} | ||
} | ||
} | ||
|
||
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y |
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.
can we improve here?
? [Get<M[K], 'state'>, getConsumerActionsType<Get<M[K], 'actions'>>] | ||
? S extends (...args: any) => void | ||
? [ | ||
Equals<ReturnType<S>, unknown> extends true |
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.
unknown
=> any
, see: :157
src/middlewares.ts
Outdated
) { | ||
setter.selectorRef = setter.selector(Global.State[modelName]) |
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.
React will check state as shadowEq, double check here is heavy.
f0297ac
to
5134373
Compare
re #46