-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PromiseVoidFunction import to multiple files
- Loading branch information
Showing
10 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import Dictionary from 'Common/Types/Dictionary'; | ||
import BadDataException from 'Common/Types/Exception/BadDataException'; | ||
import { PromiseVoidFunction } from 'Common/Types/FunctionTypes'; | ||
|
||
export default class JobDictionary { | ||
private static dictionary: Dictionary<Function> = {}; | ||
private static dictionary: Dictionary<PromiseVoidFunction> = {}; | ||
|
||
public static getJobFunction(name: string): Function { | ||
public static getJobFunction(name: string): PromiseVoidFunction { | ||
if (this.dictionary[name]) { | ||
return this.dictionary[name] as Function; | ||
return this.dictionary[name] as PromiseVoidFunction; | ||
} | ||
|
||
throw new BadDataException('No job found with name: ' + name); | ||
} | ||
|
||
public static setJobFunction(name: string, job: Function): void { | ||
public static setJobFunction(name: string, job: PromiseVoidFunction): void { | ||
this.dictionary[name] = job; | ||
} | ||
} |