Formatting.

This commit is contained in:
mike12345567 2021-03-15 20:43:31 +00:00
parent 8b9271e5b7
commit bec6ff0881
1 changed files with 19 additions and 15 deletions

View File

@ -1,12 +1,12 @@
<script> <script>
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from "svelte"
import Colorpicker from "@budibase/colorpicker" import Colorpicker from "@budibase/colorpicker"
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher()
export let value export let value
const WAIT = 150; const WAIT = 150
function throttle(callback, wait, immediate = false) { function throttle(callback, wait, immediate = false) {
let timeout = null let timeout = null
@ -30,9 +30,13 @@
} }
} }
const onChange = throttle(e => { const onChange = throttle(
dispatch('change', e.detail) e => {
}, WAIT, true) dispatch("change", e.detail)
},
WAIT,
true
)
</script> </script>
<Colorpicker value={value || '#C4C4C4'} on:change={onChange} /> <Colorpicker value={value || '#C4C4C4'} on:change={onChange} />