import { AppLeaveActionFactory , AppLeaveActionType , AppLeaveAction , AppLeaveConfirmAction , AppLeaveHandler , } from './types' ; const appLeaveActionFactory = { confirm ( text , title ? , callback ? ) { return { type : AppLeaveActionType . confirm , text , title , callback } ; } , default ( ) { return { type : AppLeaveActionType . default } ; } , } ; export function isConfirmAction ( action ) { return action . type === AppLeaveActionType . confirm ; } export function getLeaveAction ( handler ? , nextAppId ? ) { if ( ! handler ) { return appLeaveActionFactory . default ( ) ; } return handler ( appLeaveActionFactory , nextAppId ) ; }