-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noah Bogart
committed
Jan 19, 2021
1 parent
11cbe7a
commit 9be41c7
Showing
14 changed files
with
126 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import {Evaluator} from "./evaluator"; | ||
import {FixtureRiveter} from "./fixture-riveter"; | ||
|
||
export type callbackFunction = (instance: any, evaluator: Evaluator) => any; | ||
export type callbackFunction<T> = (instance: T, evaluator: Evaluator) => any; | ||
|
||
export class Callback { | ||
export class Callback<T> { | ||
fixtureRiveter: FixtureRiveter; | ||
name: string; | ||
block: callbackFunction; | ||
block: callbackFunction<T>; | ||
|
||
constructor(fixtureRiveter: FixtureRiveter, name: string, block: callbackFunction) { | ||
constructor(fixtureRiveter: FixtureRiveter, name: string, block: callbackFunction<T>) { | ||
this.fixtureRiveter = fixtureRiveter; | ||
this.name = name; | ||
this.block = block; | ||
} | ||
|
||
async run(instance: any, evaluator: Evaluator): Promise<any> { | ||
async run(instance: T, evaluator: Evaluator): Promise<any> { | ||
return this.block.call(this.fixtureRiveter, instance, evaluator); | ||
} | ||
} |
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
Oops, something went wrong.