Skip to content

Commit bfc8838

Browse files
committed
fix(config): make config optional for scrolltotop
1 parent e858972 commit bfc8838

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/services/service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,14 @@ const makeScrollToAction = (scrollToFunc: Function) => (node: Node, options: Scr
158158
};
159159
};
160160

161+
const makeScrollToActionOptional = (scrollToFunc: Function) => (node: Node, options?: ScrollToElementOptions) => {
162+
return makeScrollToAction(scrollToFunc)(node, options);
163+
};
164+
161165
// Actions
162166
export const scrollto = makeScrollToAction(scrollTo);
163-
export const scrolltotop = makeScrollToAction(scrollToTop);
164-
export const scrolltobottom = makeScrollToAction(scrollToBottom);
167+
export const scrolltotop = makeScrollToActionOptional(scrollToTop);
168+
export const scrolltobottom = makeScrollToActionOptional(scrollToBottom);
165169

166170
// Methods
167171
export const animateScroll = {

0 commit comments

Comments
 (0)