fix behaviour

This commit is contained in:
Alfred Melch 2019-12-14 20:02:56 +01:00
parent 74c0ed1de0
commit 38b1082772

View File

@ -1,4 +1,4 @@
import React, { useCallback } from 'react' import React from 'react'
import { useSelector, useDispatch } from 'react-redux' import { useSelector, useDispatch } from 'react-redux'
import { debounce } from 'debounce' import { debounce } from 'debounce'
@ -12,15 +12,13 @@ export const Options = () => {
return ( return (
<div> <div>
<h2>Options</h2>
<Slider <Slider
title={'Maximum segment length'} title={'Maximum segment length'}
min={3} min={3}
max={15} max={15}
value={maxLength} value={maxLength}
onChange={useCallback( onChange={debounce(val => dispatch(setMaxLength(val)), 100)}
debounce(val => dispatch(setMaxLength(val)), 100, true),
[dispatch]
)}
/> />
<Slider <Slider
title={'Words per minute'} title={'Words per minute'}