當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript isEmpty.default函數代碼示例

本文整理匯總了TypeScript中lodash/isEmpty.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: processResponse

 processResponse(response) {
   this.loading = false
   let results = response.data.results
   if (results) {
     this.cachedGeolocation = results[0].geometry
     if (!isEmpty(this.cachedGeolocation)) {
       this.searchkit._search()
     }
   } else {
     this.cachedGeolocation = {}
   }
 }
開發者ID:teisman,項目名稱:searchkit,代碼行數:12,代碼來源:LocationAccessor.ts

示例2: buildSharedQuery

 buildSharedQuery(query) {
   let q = (this.state.getValue() || "") + ""
   if (q && !this.loading) {
     let radius = this.searchkit.getAccessorByType(RadiusAccessor).getRadius()
     let geolocation = this.getCachedGeolocation(q)
     if (!isEmpty(geolocation)) {
       let geoFilter = GeoQuery(this.options.queryField, {
         lat: geolocation.lat,
         lon: geolocation.lng,
         distance: radius
       })
       let selectedFilter = {
         name: this.options.title,
         value: q,
         id: this.key,
         remove: () => this.state = this.state.clear()
       }
       return query.addFilter(this.key, geoFilter).addSelectedFilter(selectedFilter)
     } else {
       this.getCachedGeolocation(q)
     }
   }
   return query
 }
開發者ID:teisman,項目名稱:searchkit,代碼行數:24,代碼來源:LocationAccessor.ts

示例3: canActivate

    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
        // this will be passed from the route config
        // on the data property
        const expectedRole = route.data.expectedRole;

        const token = localStorage.getItem('token');
        // decode the token to get its payload
        const tokenPayload = decode(token);

        if (this.auth.isAuthenticated()) {
            if (!isEmpty(route.data)) {
                if (tokenPayload.sub.role !== expectedRole) {                  
                    this.router.navigate(['/workschedule']);
                } else {
                    return true;
                }
            } else {
                return true;
            }
        } else {
            // not logged in so redirect to login page with the return url
            this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
        }  
    }
開發者ID:mdenuil,項目名稱:2.2-frontend,代碼行數:24,代碼來源:auth.guard.ts

示例4: filter

 val = filter(val, f => !isEmpty(f))
開發者ID:BenJamesbabala,項目名稱:searchkit,代碼行數:1,代碼來源:BoolQueries.ts

示例5: invariant

const checkKey = (key) => invariant(
  isString(key) && !isEmpty(key),
  '(app/utils...) injectSaga: Expected `key` to be a non empty string'
);
開發者ID:,項目名稱:,代碼行數:4,代碼來源:

示例6: getUniqueStoreKey

export function getUniqueStoreKey(type, query) {
    return _isEmpty(query)
        ? type
        : type + JSON.stringify(query);
}
開發者ID:pinkasey,項目名稱:activegan,代碼行數:5,代碼來源:list.ts

示例7: hasValue

 hasValue(){
   return !isEmpty(this.value)
 }
開發者ID:Baltox,項目名稱:searchkit,代碼行數:3,代碼來源:ObjectState.ts


注:本文中的lodash/isEmpty.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。