Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] [TS Migration] Migrate 'clearCache' lib to TypeScript #26749

Merged
Show file tree
Hide file tree
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
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;
Loading