Skip to content

Commit

Permalink
Add types file
Browse files Browse the repository at this point in the history
  • Loading branch information
kowczarz committed Sep 5, 2023
1 parent de02214 commit 0a38864
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/libs/actions/Session/clearCache/index.native.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {CachesDirectoryPath, unlink} from 'react-native-fs';
import ClearCache from './types';

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

export default clearStorage;
6 changes: 3 additions & 3 deletions src/libs/actions/Session/clearCache/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function clearStorage() {
return new Promise<void>((res) => res());
}
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 0a38864

Please sign in to comment.