@rws-framework/client
Version:
Realtime Web Suit is a web-component powered, MS FAST powered fullstack-oriented framework that you can use to create domain-agnostic modular asynchoronous components with intershared authorized states.
16 lines (11 loc) • 478 B
text/typescript
import RWSContainer, { Key } from '../_container';
function getFunctionParamNames(func: () => any): string[] {
const constructorMatch = func.toString().match(/constructor\s*\(([^)]*)\)/);
if (!constructorMatch) return null;
return constructorMatch[1].split(',').map(param => param.trim());
}
function loadDep<T>(dependencyKeyClass: Key): T
{
return RWSContainer().get(dependencyKeyClass) as T;
}
export { loadDep, getFunctionParamNames };