1
0
Fork 0
mirror of synced 2024-07-16 11:45:47 +12:00

Move stuff around to remove need for code hoisting

This commit is contained in:
Andrew Kingston 2024-05-24 10:34:58 +01:00
parent 62eb1f413e
commit 37b1bc45cf

View file

@ -12,10 +12,8 @@
const flipDurationMs = 130
const { OptionColours } = Constants
let openOption = null
let anchor = null
let options = writable(
const getDefaultColor = idx => OptionColours[idx % OptionColours.length]
const options = writable(
constraints.inclusion.map((value, idx) => ({
id: Math.random(),
name: value,
@ -24,6 +22,9 @@
}))
)
let openOption = null
let anchor = null
$: options.subscribe(updateConstraints)
const updateConstraints = options => {
@ -34,10 +35,6 @@
)
}
const getDefaultColor = idx => {
return OptionColours[idx % OptionColours.length]
}
const addNewInput = async () => {
const newId = Math.random()
const newName = getSequentialName($options, "Option ", {