@adactive/adsum-utils
Advanced tools
Comparing version 0.0.2-y.44.45 to 0.0.2-y.44.46
{ | ||
"name": "@adactive/adsum-utils", | ||
"version": "0.0.2-y.44.45", | ||
"version": "0.0.2-y.44.46", | ||
"description": "Adsum Component utils", | ||
@@ -24,3 +24,4 @@ "main": "index.js", | ||
"redux" | ||
] | ||
], | ||
"gitHead": "d514c1d43af0674b40ec4ee29b5a85b05d888cc2" | ||
} |
@@ -13,17 +13,25 @@ // @flow | ||
async init(config, fallbackOnlineApi=false) { | ||
const { | ||
endpoint, key, site, username | ||
} = config; | ||
async init(config) { | ||
const { endpoint, key, site, username } = config; | ||
const entityManagerOptions = { | ||
endpoint, | ||
site, | ||
username, | ||
key | ||
}; | ||
if (!fallbackOnlineApi) { | ||
entityManagerOptions.cacheManager = new DistCacheManager('//localhost:9001/local'); | ||
this.entityManager = new EntityManager({ | ||
endpoint, | ||
site, | ||
username, | ||
key, | ||
cacheManager: new DistCacheManager('/local'), | ||
}); | ||
} | ||
async load(cacheFirst = true, allowOutdatedCache = true) { | ||
if (cacheFirst) { | ||
return this.entityManager.loadFromCache(allowOutdatedCache) | ||
.catch(() => { | ||
console.warn('ClientAPI: no cache, failling back on live API'); | ||
return this.entityManager.load(); | ||
}); | ||
} | ||
this.entityManager = new EntityManager(entityManagerOptions); | ||
return this.entityManager.load(); | ||
} | ||
@@ -30,0 +38,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10119
11
221