Skip to content

Commit

Permalink
Merge pull request Expensify#26749 from software-mansion-labs/ts-migr…
Browse files Browse the repository at this point in the history
…ation/kowczarz/clear-cache-lib

[No QA] [TS Migration] Migrate 'clearCache' lib to TypeScript
  • Loading branch information
robertjchen authored Sep 7, 2023
2 parents d60c13e + 0a38864 commit 46e6e20
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
5 changes: 0 additions & 5 deletions src/libs/actions/Session/clearCache/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/libs/actions/Session/clearCache/index.native.js

This file was deleted.

7 changes: 7 additions & 0 deletions src/libs/actions/Session/clearCache/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {CachesDirectoryPath, unlink} from 'react-native-fs';
import ClearCache from './types';

// `unlink` is used to delete the caches directory
const clearStorage: ClearCache = () => unlink(CachesDirectoryPath);

export default clearStorage;
5 changes: 5 additions & 0 deletions src/libs/actions/Session/clearCache/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ClearCache from './types';

const clearStorage: ClearCache = () => new Promise<void>((res) => res());

export default clearStorage;
3 changes: 3 additions & 0 deletions src/libs/actions/Session/clearCache/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type ClearCache = () => Promise<void>;

export default ClearCache;

0 comments on commit 46e6e20

Please sign in to comment.