Skip to content

Commit 4c0dfbf

Browse files
committed
prettify
1 parent 3faa63d commit 4c0dfbf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

modules/fetch/cached.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ export async function insertForUrl(url: string, data: mixed) {
5959
}
6060

6161
// Does the magic: stores a Request into AsyncStorage
62-
type CacheItemArgs = {key: string, response: Response, policy: CachePolicy, bundled?: boolean}
62+
type CacheItemArgs = {
63+
key: string,
64+
response: Response,
65+
policy: CachePolicy,
66+
bundled?: boolean,
67+
}
6368
async function cacheItem({key, response, policy, bundled}: CacheItemArgs) {
6469
response = await serializeResponse(response)
6570

@@ -107,7 +112,10 @@ export async function cachedFetch(request: Request): Promise<Response> {
107112
if (process.env.NODE_ENV === 'development') {
108113
let bundledResponse = await AsyncStorage.getItem(`${ROOT}:${key}:bundled`)
109114
if (bundledResponse) {
110-
debug && console.log(`fetch(${request.url}): in dev mode; returning bundled data`)
115+
debug &&
116+
console.log(
117+
`fetch(${request.url}): in dev mode; returning bundled data`,
118+
)
111119
let {body, ...init} = JSON.parse(bundledResponse)
112120
return new Response(body, init)
113121
}

0 commit comments

Comments
 (0)