Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

feat: add isOfType helper #127

Merged
merged 7 commits into from
Dec 7, 2019
Merged

feat: add isOfType helper #127

merged 7 commits into from
Dec 7, 2019

Conversation

kotarella1110
Copy link
Contributor

@kotarella1110 kotarella1110 commented Dec 5, 2019

Added isOfType helper. (resolve #87)
I would like you to review 🙏

@the-dr-lazy
Copy link
Owner

the-dr-lazy commented Dec 5, 2019

You can extract types of given keys then in assert function just use Array.prototype.includes function to check the type of given action is available or not. Please check ofType function implementation for inspiration.
https://github.com/thebrodmann/deox/blob/8b0bbcec09703f93eb4c89398b24d1a0a4117bc8/src/of-type.ts#L42-L48

@the-dr-lazy the-dr-lazy self-requested a review December 6, 2019 06:47
@kotarella1110
Copy link
Contributor Author

I imploved ideal dts test! 4578a7a
fixed #127 (comment), #127 (comment)
I want you to review again when you have time 🙏

Copy link
Owner

@the-dr-lazy the-dr-lazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awesome PR, I learned from it a lot seriously. After solving the DTS tests problem I can merge this PR. I will change the ofType RxJS operator to use this helper function too.

@the-dr-lazy the-dr-lazy changed the base branch from master to next December 6, 2019 14:34
@the-dr-lazy the-dr-lazy force-pushed the next branch 2 times, most recently from 5d908c5 to 226ca7a Compare December 7, 2019 10:45
@kotarella1110
Copy link
Contributor Author

I am really grad to contribute to this wonderful library.
I learned a lot from creating this PR and your review 💚
Thank you very much!
I will fix the problems that you pointed out today or tomorrow!

@the-dr-lazy the-dr-lazy merged commit 3005a96 into the-dr-lazy:next Dec 7, 2019
@the-dr-lazy the-dr-lazy added this to the v3.1.0 milestone Dec 7, 2019
@the-dr-lazy the-dr-lazy added the enhancement New feature or request label Dec 7, 2019
the-dr-lazy pushed a commit that referenced this pull request Dec 7, 2019
* feat: add isOfType helper

close #87

* test: use it.each instead of it

* refactor: improved readability of isOfType

* test: improved ideal dts test of isOfType

* feat: add isOfType comment

* refactor: added ExtractAction type to improve DRY code isOfType

* test(dts): fixed wired types in dts test

fixed action arg to be passed to isOfType instead of action creator.
the-dr-lazy pushed a commit that referenced this pull request Dec 8, 2019
# [3.1.0](v3.0.1...v3.1.0) (2019-12-08)

### Features

* add isOfType helper ([#127](#127)) ([03e6210](03e6210)), closes [#87](#87)
* generalize isOfType keys argument to readonly array ([cc01d9d](cc01d9d))
@the-dr-lazy
Copy link
Owner

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request released on @next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants