This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
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
sculove
suggested changes
Oct 19, 2017
src/Visible.js
Outdated
@@ -55,6 +55,7 @@ class Visible extends Component { | |||
|
|||
this._targets = []; | |||
this._timer = null; | |||
this._supportObserver = !!window.IntersectionObserver; |
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.
How about static method?
This code is generated each time you create an instance.
src/Visible.js
Outdated
* @param {Boolean} [containment=false] Whether to check only elements that are completely contained within the reference area.<ko>기준 영역 안에 완전히 포함된 엘리먼트만 체크할지 여부.</ko> | ||
* @return {eg.Visible} An instance of a module itself<ko>모듈 자신의 인스턴스</ko> | ||
*/ | ||
observe(...params) { |
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.
How about change following code?
use defalut parameters.
observe(delay = -1, containment = false) {
// let delay = params[0];
// let containment = params[1];
// if (typeof delay !== "number") {
// containment = delay;
// delay = -1;
// }
//
// if (typeof delay === "undefined") {
// delay = -1;
// }
//
// if (typeof containment === "undefined") {
// containment = false;
// }
src/Visible.js
Outdated
@@ -55,6 +55,7 @@ class Visible extends Component { | |||
|
|||
this._targets = []; | |||
this._timer = null; | |||
this._supportObserver = !!window.IntersectionObserver; | |||
this._supportElementsByClassName = (() => { |
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.
How about static method?
This code is generated each time you create an instance.
LGTM |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#4 #10