wana
Version:
Easy observable state for React
15 lines (13 loc) • 321 B
text/typescript
import { globals } from './globals'
/** Run an effect without any observable tracking */
export function noto<T>(effect: () => T): T {
const { auto, observe } = globals
globals.auto = null
globals.observe = null
try {
return effect()
} finally {
globals.auto = auto
globals.observe = observe
}
}