UNPKG

@stimulus-library/utilities

Version:

A library of useful controllers for Stimulus

13 lines (12 loc) 289 B
export function controllerMethod(controller, methodName) { const method = controller[methodName]; if (typeof method == "function") { return method; } else if (method != undefined) { return () => method; } else { return () => void 0; } }