From bc1f554dbdddbe0537628845b2dd23d73f183100 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Sat, 25 Feb 2017 18:16:03 -0600 Subject: [PATCH] feat(onEnter/Exit/Retain): Use onExit/onEnter/onRetain from 56955state(), not state.self --- src/hooks/onEnterExitRetain.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/hooks/onEnterExitRetain.ts b/src/hooks/onEnterExitRetain.ts index dca1c0d5..67bf9fb2 100644 --- a/src/hooks/onEnterExitRetain.ts +++ b/src/hooks/onEnterExitRetain.ts @@ -1,8 +1,10 @@ -/** @module hooks */ /** for typedoc */ -import {TransitionStateHookFn} from "../transition/interface"; -import {Transition} from "../transition/transition"; -import {TransitionService} from "../transition/transitionService"; +/** @module hooks */ +/** for typedoc */ +import { TransitionStateHookFn } from '../transition/interface'; +import { Transition } from '../transition/transition'; +import { TransitionService } from '../transition/transitionService'; import { StateDeclaration } from '../state/interface'; +import { StateObject } from '../state/stateObject'; /** * A factory which creates an onEnter, onExit or onRetain transition hook function @@ -14,7 +16,8 @@ import { StateDeclaration } from '../state/interface'; */ function makeEnterExitRetainHook(hookName: string): TransitionStateHookFn { return (transition: Transition, state: StateDeclaration) => { - let hookFn: TransitionStateHookFn = state[hookName]; + let _state: StateObject = state.$$state(); + let hookFn: TransitionStateHookFn = _state[hookName]; return hookFn(transition, state); } }