UNPKG

@tempots/dom

Version:

Fully-typed frontend framework alternative to React and Angular

15 lines (14 loc) 682 B
import { BrowserContext } from '../dom/browser-context'; import { Renderable, TNode } from '../types/domain'; /** * Returns a renderable function that executes the given function with the * current DOMContext as argument. * The given function can return a TNode or void. If you need to perform some * actions when the Renderable is disposed, you can use `OnDispose` as the * return value. * * @param fn - The function to be executed with the DOMContext argument. * @returns A Clear function that can be used to clean up any resources associated with the execution. * @public */ export declare const OnBrowserCtx: (fn: (ctx: BrowserContext) => TNode | void) => Renderable;