mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
refactor(select-item): replace onDestroy with onMount return function
This commit is contained in:
parent
a160ef3b40
commit
1309eaef20
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
||||||
/** Set to `true` to disable the option */
|
/** Set to `true` to disable the option */
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
import { getContext, onDestroy } from "svelte";
|
import { getContext, onMount } from "svelte";
|
||||||
|
|
||||||
const ctx = getContext("Select") || getContext("TimePickerSelect");
|
const ctx = getContext("Select") || getContext("TimePickerSelect");
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
selected = currentValue === value;
|
selected = currentValue === value;
|
||||||
});
|
});
|
||||||
|
|
||||||
onDestroy(() => {
|
onMount(() => {
|
||||||
unsubscribe();
|
return () => unsubscribe();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue