UNPKG

@antv/x6

Version:

JavaScript diagramming library that uses SVG and HTML for rendering

15 lines (12 loc) 401 B
import { apply, toAsyncBoolean } from '../function' export function call(list: any[], args?: any[]) { const results: any[] = [] for (let i = 0; i < list.length; i += 2) { const handler = list[i] const context = list[i + 1] const params = Array.isArray(args) ? args : [args] const ret = apply(handler, context, params) results.push(ret) } return toAsyncBoolean(results) }