-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
What problem does this feature solve?
const person = reactive({ firstName: "John", lastName: "Doe" }); // reactive field
const fullName = computed(() => `${person.firstName} ${person.lastName}`); // effect
console.log(`You are logged as: ${fullName.value}`); // Yo
What does the proposed API look like?
console.log(`You are logged as: ${fullName}`); // Yo
maybe code change
computed = {
__v_isRef: true,
// expose effect so computed can be stopped
effect: runner,
get value() {
if (dirty) {
value = runner()
dirty = false
}
track(computed, TrackOpTypes.GET, 'value')
return value
},
set value(newValue: T) {
setter(newValue)
},
toString() {
return this.value // THIS
},
} as any
dnlsndr
Metadata
Metadata
Assignees
Labels
No labels