본문으로 건너뛰기

observe

observe<Type>(defaultValue: Type): Observer<Type>

Parameters

defaultValue

Type

Description

Creates a mutable ref object. You can access the .current value and detect the value change through .subscribe.

Example
import { observe } from "@cfcs/core";

const ob1 = observe(1);

ob1.subscribe(nextValue => {
console.log(nextValue);
});

ob1.current = 2;