Improved createEffect and cleanup
This commit is contained in:
parent
24de3a4c6c
commit
307f624015
1 changed files with 4 additions and 4 deletions
|
|
@ -4,7 +4,6 @@ import Button from '../../Button/Button'
|
||||||
import MiniCard from '../../MiniCard/MiniCard'
|
import MiniCard from '../../MiniCard/MiniCard'
|
||||||
// import ToggleSwtich from '../ToggleSwitch/ToggleSwitch'
|
// import ToggleSwtich from '../ToggleSwitch/ToggleSwitch'
|
||||||
import { Slider } from '@kobalte/core/slider'
|
import { Slider } from '@kobalte/core/slider'
|
||||||
import { Switch } from '@kobalte/core/switch'
|
|
||||||
import { Alert } from '@kobalte/core/alert'
|
import { Alert } from '@kobalte/core/alert'
|
||||||
import { Checkbox } from '@kobalte/core/checkbox'
|
import { Checkbox } from '@kobalte/core/checkbox'
|
||||||
import { FaSolidCheck } from 'solid-icons/fa'
|
import { FaSolidCheck } from 'solid-icons/fa'
|
||||||
|
|
@ -31,9 +30,10 @@ export default () => {
|
||||||
setPassword(passwordArray.join(''))
|
setPassword(passwordArray.join(''))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Effect to update the display when the length changes
|
createEffect((value) => {
|
||||||
createEffect(() => {
|
if (length() !== value) {
|
||||||
generatePassword()
|
generatePassword()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleToggleChange = (target: string) => {
|
const handleToggleChange = (target: string) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue