Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/storage/providers/NoopProvider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import type {OnyxValue} from '../../types';
import type {OnyxKey, OnyxValue} from '../../types';
import {StorageErrorClass} from '../errors';
import type StorageProvider from './types';

function emptyOnyxValue<TKey extends OnyxKey>(key: TKey): OnyxValue<TKey>;
function emptyOnyxValue(): null {
return null;
}

const provider: StorageProvider<unknown> = {
store: undefined,

Expand All @@ -26,7 +31,7 @@ const provider: StorageProvider<unknown> = {
* Get the value of a given key or return `null` if it's not available in memory
*/
getItem(_key) {
return Promise.resolve(null as OnyxValue<typeof _key>);
return Promise.resolve(emptyOnyxValue(_key));
},

/**
Expand Down
Loading