mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23: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 */
|
||||
export let disabled = false;
|
||||
|
||||
import { getContext, onDestroy } from "svelte";
|
||||
import { getContext, onMount } from "svelte";
|
||||
|
||||
const ctx = getContext("Select") || getContext("TimePickerSelect");
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
|||
selected = currentValue === value;
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
unsubscribe();
|
||||
onMount(() => {
|
||||
return () => unsubscribe();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue