UNPKG

@aplus-frontend/antdv

Version:

Vue basic component library maintained based on ant-design-vue

10 lines 254 B
import { watchEffect, shallowRef } from 'vue'; export default function eagerComputed(fn) { const result = shallowRef(); watchEffect(() => { result.value = fn(); }, { flush: 'sync' // needed so updates are immediate. }); return result; }