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 ToggleSwtich from '../ToggleSwitch/ToggleSwitch'
|
||||
import { Slider } from '@kobalte/core/slider'
|
||||
import { Switch } from '@kobalte/core/switch'
|
||||
import { Alert } from '@kobalte/core/alert'
|
||||
import { Checkbox } from '@kobalte/core/checkbox'
|
||||
import { FaSolidCheck } from 'solid-icons/fa'
|
||||
|
|
@ -31,9 +30,10 @@ export default () => {
|
|||
setPassword(passwordArray.join(''))
|
||||
}
|
||||
|
||||
// Effect to update the display when the length changes
|
||||
createEffect(() => {
|
||||
generatePassword()
|
||||
createEffect((value) => {
|
||||
if (length() !== value) {
|
||||
generatePassword()
|
||||
}
|
||||
})
|
||||
|
||||
const handleToggleChange = (target: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue