This repository has been archived by the owner on Sep 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed the issue related to calling onChange multiple times
- Loading branch information
Showing
1 changed file
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ddc0253
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.
I've though about this PR for a while and think that you can avoid extra complexity with new function and flag by adding following LoC:
and
(before
this.isOpen = true
andthis.isOpen = false
)instead of
this.isChanged()
and extra flagprevState
. What do you think?ddc0253
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.
Very smart, I like it. I think the less state the component has, the more predictable it will be.
ddc0253
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.
Great, so if you'll add this commit to PR, I'll merge it ;)