name param listenerType param action param condition export function listen ( listenerType , action , condition = true ) { if ( ! this . listeners . hasOwnProperty ( listenerType ) ) { throw new Error ( 'The event entered may be wrong' ) ; } if ( ! condition ) { return ; } this . listeners [ listenerType ] . push ( action ) ; }