File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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+ }
6368async 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 }
You can’t perform that action at this time.
0 commit comments