xatto
Version:
xatto is View Layer Library based on Function and Context using VirtualDOM. This is developed by forking from jorgebucaran/superfine.
14 lines (12 loc) • 330 B
text/typescript
import { assign } from './assign'
export function fireLifeCycleEventProvider (
elm: Node,
type: string,
detail: any = {}
) {
const events = [
new CustomEvent('lifecycle', { detail: assign({ type }, detail) }),
new CustomEvent(type, { detail })
]
return () => events.map((event) => elm.dispatchEvent(event))
}