@multisynq/react
Version:
React bindings for Multisynq
11 lines (10 loc) • 340 B
JavaScript
import { useView } from './useView';
/** Hook that sets up a callback for Multisynq.View.detach().
* The function will be called when the root View is detached.
*/
export function useDetachCallback(callback) {
const multisynqView = useView();
if (multisynqView !== null) {
multisynqView.detachCallback = callback;
}
}