refactor: 💡 Change variable name for peeking db (#2954)
This commit is contained in:
1 parent
e0982da744
commit
a4bf02b21b
15 files changed
+20
-20
No files matched your search
@@ -36,7 +36,7 @@ export default class IndexedDbHandler {
|
||||
query,
|
||||
options: {
|
||||
pushToStore = true,
|
||||
peekIndexedDB = false,
|
||||
peekDb = false,
|
||||
storeToken = true,
|
||||
} = {},
|
||||
} = data;
|
||||
@@ -55,7 +55,7 @@ export default class IndexedDbHandler {
|
||||
const schema = store.modelFor(type);
|
||||
const serializer = store.serializerFor(type);
|
||||
|
||||
if (!peekIndexedDB) {
|
||||
if (!peekDb) {
|
||||
const tokenKey = `${type}-${hashCode(remainingQuery)}`;
|
||||
let payload;
|
||||
let listToken;
|
||||
|
||||
@@ -149,7 +149,7 @@ module('Unit | Handler | indexed-db-handler', function (hooks) {
|
||||
);
|
||||
});
|
||||
|
||||
test('it loads from indexeddb only and does not fetch from api, when peekIndexedDB option is used', async function (assert) {
|
||||
test('it loads from indexeddb only and does not fetch from api, when peekDb option is used', async function (assert) {
|
||||
const callCounts = {
|
||||
get writeToIndexedDb() {
|
||||
return indexedbHandlerSpy.writeToIndexedDb.callCount;
|
||||
@@ -181,7 +181,7 @@ module('Unit | Handler | indexed-db-handler', function (hooks) {
|
||||
expectedWriteToIndexedDbCallCount,
|
||||
);
|
||||
|
||||
await store.query('alias', {}, { peekIndexedDB: true });
|
||||
await store.query('alias', {}, { peekDb: true });
|
||||
assert.strictEqual(results.length, 50);
|
||||
|
||||
// second run does not increase call counts to api or writes to indexeddb
|
||||
|
||||
Reference in new issue
Block a user