Skip to content
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

refactor: make classes for each move types #194

Merged
merged 2 commits into from
May 3, 2019

Conversation

WoodNeck
Copy link
Member

@WoodNeck WoodNeck added 🔖3.x v3.x~ related issue ♻️Refactoring Refactoring code / structure labels Apr 30, 2019
@WoodNeck WoodNeck self-assigned this Apr 30, 2019
@coveralls
Copy link

coveralls commented Apr 30, 2019

Coverage Status

Coverage decreased (-0.04%) to 89.666% when pulling 6188b2c on WoodNeck:refactor-move-type#189 into 2819fa4 on naver:master.

const currentPanelPosition = currentPanel.getPosition();
const currentPanelSize = currentPanel.getSize();

let minimumDistanceToChange: number;
Copy link
Member

Choose a reason for hiding this comment

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

@WoodNeck
Couldn't parts related to minimumDistanceToChange also enter the MoveType class area?

Copy link
Member Author

Choose a reason for hiding this comment

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

It could be done, but I also thought that the only changing part will be only for freeScroll move type, so I might be hesitated.
But I guess you're right. This might be included on MoveType I guess.

@@ -64,16 +65,36 @@ export interface FlickingOptions {
moveType: MoveTypeOption;
}

export type MoveTypeObjectOption = MoveTypeSnapOption | MoveTypeFreeScrollOption;
export type MoveTypeStringOption = MoveTypeObjectOption["type"];
Copy link

Choose a reason for hiding this comment

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

@WoodNeck wow~~ it's good

} = {
SNAP: "snap",
FREE_SCROLL: "freeScroll",
};
Copy link

Choose a reason for hiding this comment

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

@WoodNeck What is this syntax?

Copy link
Member Author

Choose a reason for hiding this comment

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

By doing that, MOVE_TYPE.SNAP's type inference will be "snap", while string will be inferred if not.

Copy link
Member

@daybrush daybrush left a comment

Choose a reason for hiding this comment

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

LGTM

@WoodNeck WoodNeck merged commit 8c47238 into naver:master May 3, 2019
@WoodNeck WoodNeck deleted the refactor-move-type#189 branch May 3, 2019 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔖3.x v3.x~ related issue ♻️Refactoring Refactoring code / structure
Projects
None yet
4 participants