@cran/lib.vue.ref
Version:
Vue Reactivity Extensions
21 lines (20 loc) • 688 B
TypeScript
import { type ShallowRef } from "vue";
/**
* @since 0.0.1
* @category Utility
*/
export type EagerComputed<T = any> = ReturnType<typeof eagerComputed<T>>;
/**
* Use computed() when you have a complex
* calculation going on, which can actually profit
* from caching and lazy evaluation and should only
* be (re-)calculated if really necessary.
*
* Use eagerComputed() when you have a simple
* operation, with a rarely changing return value –
* often a boolean.
* @since 0.0.1
* @category Utility
* @see https://dev.to/linusborg/vue-when-a-computed-property-can-be-the-wrong-tool-195j
*/
export declare function eagerComputed<T>(factory: () => T): Readonly<ShallowRef<T>>;