No reading zone in logic factories and constructors
betula opened this issue · 1 comments
betula commented
class CounterLogic {
@prop value = 0;
inc = () => (this.value += 1);
constructor() {
console.log(this.value);
}
}
let n = 0;
const Counter = observe(() => {
const { inc } = useLocal(CounterLogic);
console.log("Render", n++);
return <button onClick={inc}>+</button>;
});
export const App = () => <Counter />;
The component was subscribed to value
and reacted the first time on It change, but not used inside.