valtio-reactive
Version:
valtio-reactive makes Valtio a reactive library
12 lines (11 loc) • 335 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.effect = effect;
const core_js_1 = require("./core.js");
function effect(fn, cleanup) {
const unwatch = (0, core_js_1.watch)(fn);
return () => {
unwatch();
cleanup === null || cleanup === void 0 ? void 0 : cleanup();
};
}