Skip to content

Instantly share code, notes, and snippets.

@alx-andru
Created November 1, 2018 13:45
Show Gist options
  • Save alx-andru/b04e5d85b89cc1b9a01ff02c94081ff1 to your computer and use it in GitHub Desktop.
Save alx-andru/b04e5d85b89cc1b9a01ff02c94081ff1 to your computer and use it in GitHub Desktop.
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