Created
November 1, 2018 13:45
-
-
Save alx-andru/b04e5d85b89cc1b9a01ff02c94081ff1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export function logout(reducer: ActionReducer<any>): ActionReducer<any> { | |
return function(state: any, action: any) { | |
// Reset state if user logs out | |
if (action.type === OidcActions.OidcActionTypes.OnUserSignedOut) { | |
return reducer(undefined, action); | |
} | |
return reducer(state, action); | |
}; | |
} | |
export const metaReducers: MetaReducer<AppState>[] = [logout]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment