本文整理汇总了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 = {}
}
}
示例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
}
示例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 }});
}
}
示例4: filter
val = filter(val, f => !isEmpty(f))
示例5: invariant
const checkKey = (key) => invariant(
isString(key) && !isEmpty(key),
'(app/utils...) injectSaga: Expected `key` to be a non empty string'
);
示例6: getUniqueStoreKey
export function getUniqueStoreKey(type, query) {
return _isEmpty(query)
? type
: type + JSON.stringify(query);
}
示例7: hasValue
hasValue(){
return !isEmpty(this.value)
}