-
-
Save ycmjason/1f91cb51db6c214f70c0052f1c430458 to your computer and use it in GitHub Desktop.
This file contains 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
const computed = <T>(fn: () => T): Ref<T> => { | |
const r = ref<T>(undefined as any) | |
watch(() => { | |
r.value = fn() | |
}) | |
return r | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment