-
Notifications
You must be signed in to change notification settings - Fork 139
Feat/state api #923
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
Feat/state api #923
Conversation
* fix: apply ResizeObserver to camera and panels * fix: unobserve removed panel when panel change * fix: add defense code to check if element exists * feat: add resizeObservePanel option * fix: add defensive logic to getStyle * chore: change resizeObservePanel to resizePanelObserve * fix: add unobserve panel logic * chore: update setup-node to v4
* fix: infinite resize * chore: remove route for removed demo * fix: prevent calling viewport.resize() when isResizing * chore: add type info * chore: add script to link core and framework for debug * chore: create reference demo page * fix: calculate resized size using getElementSize * feat: add optimizeSizeUpdate option * chore: disable eslint for helper script * refactor: declare variable for resizeTarget * test: changed import path to relative path * fix: changed viewport resize condition * chore: add comments --------- Co-authored-by: jinwoo-choi-05 <[email protected]>
src/state-api/index.ts
Outdated
| return percent; | ||
| }; | ||
|
|
||
| export type FlickingStateApi = ReactiveObject<{ |
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.
아래 상태 interface가 있기도 하고, 메서드 interface를 만들고 Intersection 타입으로 만드시는게 좋을 것 같습니다.
src/state-api/index.ts
Outdated
| scrollProgress: number; | ||
| } | ||
|
|
||
| const flickingStateApiAdapter: ReactiveSetupAdapter<FlickingStateApi, FlickingReactiveState, "moveTo"> = ({ onInit, onDestroy }) => { |
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.
data 타입도 있을거에요.
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.
말씀주신 data 타입이라는 게 어떤 걸 말씀하시는 걸까요?
src/state-api/index.ts
Outdated
| currentPanelIndex: number; | ||
| indexProgress: number; | ||
| scrollProgress: number; | ||
| moveTo: (i: number) => Promise<void> | undefined; |
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.
flicking instance가 없는 경우 Promise.reject를 호출해도 괜찮을 것 같습니다.
Issue
Flicking state api implementation
Details