Last active
March 29, 2024 11:22
-
-
Save TheLucifurry/5e78974cd87c65d8645558989606c2f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ref } from 'vue' | |
| /** | |
| * Creates a reactive Set | |
| * Allows access without using ".value", | |
| * unlike the direct declaration of `ref(new Set())`, | |
| * while retaining reactivity when using its methods | |
| */ | |
| export function useSet<T>(...args: ConstructorParameters<typeof Set<T>>) { | |
| return ref(new Set<T>(...args)).value as Set<T> | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment