A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
/* Copyright 2026 Marimo. All rights reserved. */
import { type EffectCallback, useEffect } from "react";
/**
* Wrapper around useEffect that makes it clearer that the effect is run, just on mount.
*/
export function useOnMount(effect: EffectCallback) {
// oxlint-disable-next-line react-hooks/exhaustive-deps
useEffect(effect, []);
}
/**
* Wrapper around useEffect that makes it clearer that the effect is run, just on unmount.
*/
export function useOnUnmount(effect: EffectCallback) {
// oxlint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => {
return effect();
}, []);
}