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(react-scheduler): simplify the onNavigate function arguments #1659

Merged

Conversation

SergeyAlexeev
Copy link
Contributor

@SergeyAlexeev SergeyAlexeev commented Nov 29, 2018

BREAKING CHANGE:

We changed the onNavigate function's argument type to make the DateNavigator's API more clear.

Previously:

onNavigate({ back: boolean }) => void

Now:

onNavigate(direction: 'forward' | 'back') => void

}) => (
nextDate || moment(currentDate)[back ? 'subtract' : 'add'](amount, step).toDate()
nextDate || moment(currentDate)[direction === 'back' ? 'subtract' : 'add'](amount, step).toDate()
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case we can remove initial value for a direction argument.

direction = 'forward', => direction,

@SergeyAlexeev SergeyAlexeev merged commit 7e41042 into DevExpress:master Dec 7, 2018
@SergeyAlexeev SergeyAlexeev deleted the scheduler-fix-ts-definitions branch December 7, 2018 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants