import { EventDefinition } from 'redux-beacon' ; const ensure = ( isValid , eventDef ) : EventDefinition => ( action , prevState , nextState ) => { const event = eventDef ( action , prevState , nextState ) ; return isValid ( event ) ? event : null ; } ; export default ensure ;