mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
16 lines
444 B
TypeScript
16 lines
444 B
TypeScript
import { AppMainElement } from 'components/';
|
|
|
|
export default function findMethod(actionString: string, appMain: AppMainElement): Function {
|
|
if (actionString && appMain) {
|
|
const methodSep = actionString.lastIndexOf('#');
|
|
const tag = actionString.slice(0, methodSep);
|
|
const method = actionString.slice(methodSep + 1);
|
|
|
|
const element = appMain.querySelector(tag);
|
|
if (element) {
|
|
return element?.[method];
|
|
}
|
|
}
|
|
return () => {};
|
|
}
|