Move stuff around to remove need for code hoisting
This commit is contained in:
parent
62eb1f413e
commit
37b1bc45cf
|
@ -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 ", {
|
||||
|
|
Loading…
Reference in New Issue