diff --git a/src/sparky/SparkyContext.ts b/src/sparky/SparkyContext.ts index fa8604d74..5e5840638 100644 --- a/src/sparky/SparkyContext.ts +++ b/src/sparky/SparkyContext.ts @@ -13,14 +13,14 @@ export function getSparkyContext() { return SparkyCurrentContext; } -export function SparkyContext(target: () => { [key: string]: any } | (new () => any) | { [key: string]: any }) { +export function SparkyContext(target: { [key: string]: any } | (new () => any) | (() => { [key: string]: any })) { if (utils.isPlainObject(target)) { SparkyCurrentContext = target; } else if (isClass(target)) { const Class: any = target; SparkyCurrentContext = new Class(); } else if (utils.isFunction(target)) { - SparkyCurrentContext = target(); + SparkyCurrentContext = (target)(); } return new SparkyContextClass(SparkyCurrentContext); }