Skip to content
This repository was archived by the owner on Oct 1, 2022. It is now read-only.

Commit dfdb022

Browse files
committed
fixed config context error
1 parent b0e3383 commit dfdb022

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/storage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class Storage {
2222
});
2323

2424
// assume if user provided get, set or remove methods that the storage type is custom
25-
if (config.get || config.set || config.remove) {
25+
if (this.config.get || this.config.set || this.config.remove) {
2626
this.config.type = 'custom';
2727
}
2828

@@ -35,12 +35,12 @@ export default class Storage {
3535
// Local storage not available, fallback to custom.
3636
this.config.type = 'custom';
3737
// ensuring all required storage properties are set
38-
if (isFunction(config.get) && isFunction(config.set) && isFunction(config.remove)) {
38+
if (isFunction(this.config.get) && isFunction(this.config.set) && isFunction(this.config.remove)) {
3939
// if asynchronous and developer did not explicitly define so, check
40-
if (this.config.async === undefined && isAsync(config.get)) this.config.async = true;
40+
if (this.config.async === undefined && isAsync(this.config.get)) this.config.async = true;
4141
this.storageReady = true;
4242
} else {
43-
console.warn('Pulse Error: Persistent storage not configured, check get, set and remove methods', config);
43+
console.warn('Pulse Error: Persistent storage not configured, check get, set and remove methods', this.config);
4444
this.storageReady = false;
4545
}
4646
}

0 commit comments

Comments
 (0)