import { useEffect, useState } from 'react';
export function useReactive(reactive) {
    const [state, setState] = useState(reactive.value);
    useEffect(() => {
        if (reactive.value !== state) {
            setState(reactive.value);
        }
        return reactive.addListener(() => {
            setState(reactive.value);
        });
    }, []);
    return state;
}
//# sourceMappingURL=useReactive.js.map