Skip to content

Commit eb12ec8

Browse files
csvnchristopherthielen
authored andcommitted
feat(params): add option to use generic type for Transition.params (#17)
* added option to use generic type for Transition.params, e.g., `trans.params<MyInterface>()` Closes #16
1 parent aa551e4 commit eb12ec8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/transition/transition.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ export class Transition implements IHookRegistry {
259259
*
260260
* @returns transition parameter values for the desired path.
261261
*/
262-
params(pathname: string = "to"): { [key: string]: any } {
262+
params(pathname?: string): any;
263+
params<T>(pathname?: string): T;
264+
params(pathname: string = "to") {
263265
return this._treeChanges[pathname].map(prop("paramValues")).reduce(mergeR, {});
264266
}
265267

0 commit comments

Comments
 (0)