fix(core): update
This commit is contained in:
parent
40175dc4de
commit
7fb47d224e
11
test/test.typedrequestcache.browser.ts
Normal file
11
test/test.typedrequestcache.browser.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
|
import * as webstore from '../ts/index';
|
||||||
|
|
||||||
|
let testTypedrequestcache: webstore.TypedrequestCache;
|
||||||
|
|
||||||
|
tap.test('first test', async () => {
|
||||||
|
testTypedrequestcache = new webstore.TypedrequestCache('https://test.lossless.com/typedrequest')
|
||||||
|
expect(testTypedrequestcache).to.be.instanceOf(webstore.TypedrequestCache);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
@ -1 +1,2 @@
|
|||||||
|
export * from './webstore.classes.typedrequestcache';
|
||||||
export * from './webstore.classes.webstore';
|
export * from './webstore.classes.webstore';
|
||||||
|
@ -5,10 +5,14 @@ import * as plugins from './webstore.plugins';
|
|||||||
* a cache that can be used to store and retrieve typedrequests
|
* a cache that can be used to store and retrieve typedrequests
|
||||||
*/
|
*/
|
||||||
export class TypedrequestCache {
|
export class TypedrequestCache {
|
||||||
private webstore = new WebStore<plugins.typedrequestInterfaces.ITypedRequest>({
|
private webstore: WebStore;
|
||||||
dbName: 'trStore',
|
|
||||||
storeName: 'trStore',
|
constructor(domainArg = 'default') {
|
||||||
});
|
this.webstore = new WebStore<plugins.typedrequestInterfaces.ITypedRequest>({
|
||||||
|
dbName: 'trStore',
|
||||||
|
storeName: `trStore-${domainArg}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private buildKey(requestArg: plugins.typedrequestInterfaces.ITypedRequest) {
|
private buildKey(requestArg: plugins.typedrequestInterfaces.ITypedRequest) {
|
||||||
return plugins.smartjson.stringify({
|
return plugins.smartjson.stringify({
|
||||||
|
Loading…
Reference in New Issue
Block a user