@opendatasoft/visualizations
Version:
Opendatasoft's components to easily build dashboards and visualizations.
16 lines (14 loc) • 419 B
text/typescript
import tippy, { Props } from 'tippy.js';
import 'tippy.js/dist/tippy.css';
import './themes.scss';
export default function tippyAction(node: HTMLElement, initialProps: Partial<Props>) {
const instance = tippy(node, initialProps);
return {
update: (props: Partial<Props>) => {
instance.setProps(props);
},
destroy: () => {
instance.destroy();
},
};
}