import { connect } from "react-redux" ; import { Dispatch } from "redux" ; import { Session } from "common" ; import { State } from "providers/store" ; import { initSessionAction , SessionActions , SessionState , terminateSessionAction } from "providers/store/session" ; /**
 * Session state properties
 */ export interface WithSessionState { session : SessionState ; } /**
 * Session dispatcher properties
 */ export interface WithSessionDispatch { initSession ( session ) : void ; terminateSession ( ) : void ; } /**
 * Session properties
 */ export type WithSession = WithSessionState & WithSessionDispatch ; return export const withSession = ( ) => connect < WithSessionState , WithSessionDispatch , { } , State > ( ( { session } ) => ( { session } ) , ( dispatch ) => ( { initSession : session => dispatch ( initSessionAction ( session ) ) , terminateSession : ( ) => dispatch ( terminateSessionAction ( ) ) } ) ) ;