import { autorun } from 'mobx' ; import { useAsObservableSource } from 'mobx-react-lite' ; import * as React from 'react' ; param effect param observed export function useObservableEffect < TProps > ( effect , observed = { } as any ) { const observableProps = useAsObservableSource ( observed ) ; React . useEffect ( ( ) => autorun ( ( ) => effect ( observableProps ) ) , [ ] ) ; }