partialReactive
partialReactive<Object>(setup: Readonly<Object> | (() => Readonly<Object>)): ParitalReactiveObject<Object>
Parameters
setup
Readonly<Object> | (() => Readonly<Object>)
The target object or function to which reactive is applied
Description
Make the return value of the corresponding object or function a reactive object.
Returns
Only the values to which observer is applied are objects to which reactive is applied.
Example
import { partialReactive, observe } from "@cfcs/core";
const value1 = observe(1);
const value2 = observe(2);
const obj = partialReactive({
value1,
value2,
});
obj.subscribe("value1", value1 => {
console.log(value1);
});
value1.current = 2;