-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add Brand type #67
Add Brand type #67
Conversation
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.
Looks good, could you please check and apply my review comments? Thanks!
README.md
Outdated
@@ -832,6 +833,29 @@ function makeStore(storeClass: Class<Store>): Store { | |||
|
|||
[⇧ back to top](#flows-utility-types) | |||
|
|||
### `Brand<T, U>` |
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.
It should be located in Mapped Types
src/utility-types.ts
Outdated
* Brand | ||
* @desc Define nominal type of U based on type of T. | ||
*/ | ||
export type Brand<T, U> = T & { __brand: U }; |
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.
please move to Mapped Types
src/utility-types.ts
Outdated
/** | ||
* Brand | ||
* @desc Define nominal type of U based on type of T. | ||
*/ |
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.
@piotrwitek Thank you reviewing! I fixed them. Please re-review 👓 |
/** | ||
* Brand | ||
* @desc Define nominal type of U based on type of T. | ||
* @example |
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.
That's looking great.
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.
Looking good!
Thanks for your contribution @airtoxin! |
Fix #66