nl_tokens: / * Loads object ( s ) from endpoint or falls back to object [ labelProperty ] - > object [ keyProperty ]
pl_tokens: function loadObjectData ( object , keyProperty , labelProperty , objectLoader , onLoadingStart = ( ) => { } , onLoadingEnd = ( ) => { } ) { if ( isNil ( object ) ) { return Promise . resolve ( object ) ; } // is multiple if ( Array . isArray ( object ) ) { const someObjectHasNoLabel = object . some ( item => ! hasIn ( item , labelProperty ) ) ; if ( someObjectHasNoLabel ) { onLoadingStart ( ) ; return Promise . <mask> ( object . map ( item => _loadSingleObject ( item , keyProperty , labelProperty , objectLoader ) ) ) . then ( responses => { onLoadingEnd ( ) ; return responses . map ( response => _getObjectWithFallback ( response , keyProperty , labelProperty ) ) ; } ) ; } else { return Promise . resolve ( object ) ; } } else { onLoadingStart ( ) ; return _loadSingleObject ( object , keyProperty , labelProperty , objectLoader ) . then ( result => { onLoadingEnd ( ) ; return result ; } ) ; } }