From ccff9b39bed7a08cf7bff67e8ef3bc0ff79cf424 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 25 May 2020 15:38:57 +0000 Subject: [PATCH] fix(core): update --- ts/lik.stringmap.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ts/lik.stringmap.ts b/ts/lik.stringmap.ts index 1a4d6e1..5a9eb73 100644 --- a/ts/lik.stringmap.ts +++ b/ts/lik.stringmap.ts @@ -4,13 +4,11 @@ import * as plugins from './lik.plugins'; * allows you to easily keep track of a bunch of strings */ -export interface ITriggerFunction { - (): boolean; -} +export type TTriggerFunction = (stringArray?: string[]) => boolean; export class Stringmap { private _stringArray: string[] = []; - private _triggerUntilTrueFunctionArray: ITriggerFunction[] = []; + private _triggerUntilTrueFunctionArray: TTriggerFunction[] = []; constructor() {} /** * add a string to the Stringmap @@ -92,10 +90,10 @@ export class Stringmap { /** * register a new trigger */ - public registerUntilTrue(functionArg: ITriggerFunction, callbackArg?: () => any) { + public registerUntilTrue(functionArg: TTriggerFunction, callbackArg?: () => any) { const trueDeferred = plugins.smartpromise.defer(); this._triggerUntilTrueFunctionArray.push(() => { - const result = functionArg(); + const result = functionArg(this.getStringArray()); if (result === true) { if (callbackArg) { callbackArg();