Skip to content

Commit

Permalink
Merge pull request #30 from nicoespeon/debounce-datepicker
Browse files Browse the repository at this point in the history
Don't update on every datepicker keystroke. Close #28
  • Loading branch information
nicoespeon committed Jun 12, 2016
2 parents c9d9df5 + c1ee148 commit af4b6a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function main({ DOMAboveChart, DOMBelowChart, TrelloFetch, TrelloMissingInfo, St
displayedLists$: trelloDisplayedLists$,
dates$: selectedDates$,
props$: Observable.of({
label: 'Get actions',
label: 'Refresh data',
classNames: ['btn waves-effect waves-light trello-green'],
}),
previewTomorrow$: previewTomorrow.checked$,
Expand Down
4 changes: 3 additions & 1 deletion app/components/LabeledDatePicker/LabeledDatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ function LabeledDatePicker({ DOM, props$, value$ }) {
const newSelected$ = DOM
.select('.datepicker')
.events('change')
.map(ev => ev.target.value);
.debounce(500)
.map(ev => ev.target.value)
.distinctUntilChanged();

const selected$ = Observable.merge(
value$,
Expand Down

0 comments on commit af4b6a1

Please sign in to comment.