nl_tokens: If object has [ labelProperty ] - > object else load object from enpoint if result has [ labelProperty ] - > return result else return fallback
pl_tokens: function _loadSingleObject ( object , keyProperty , labelProperty , objectLoader ) { if ( hasIn ( object , labelProperty ) ) { // label exists -> return object as it is return Promise . resolve ( object ) ; } else if ( object [ keyProperty ] === undefined ) { // key property is not specified -> return object as it is return Promise . resolve ( object ) ; } else { return objectLoader ( object [ keyProperty ] ) . then ( ( response ) => { return _getObjectWithFallback ( <mask> . body , keyProperty , labelProperty ) } ) . catch ( ( error ) => { return _getObjectWithFallback ( object , keyProperty , labelProperty ) } ) } }