minor reorg/cleanup

This commit is contained in:
austinried
2022-04-28 15:41:45 +09:00
parent adcda47007
commit e40de711c1
29 changed files with 403 additions and 386 deletions
+17
View File
@@ -0,0 +1,17 @@
import RNFS from 'react-native-fs'
import path from 'path'
import { CacheItemTypeKey } from '@app/models/cache'
const serversCacheDir = path.join(RNFS.ExternalDirectoryPath, 's')
function cacheDir(serverId?: string, itemType?: CacheItemTypeKey, itemId?: string): string {
const segments: string[] = []
serverId && segments.push(serverId)
serverId && itemType && segments.push(itemType)
serverId && itemType && itemId && segments.push(itemId)
return path.join(serversCacheDir, ...segments)
}
export default cacheDir