mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 17:33:15 +08:00
fix getter of result from Image query cache (#23602)
Summary: We assume `map` is the type of `Map`, but actually it's not, so we would get type error. [iOS] [Fixed] - [RNTester] fix getter of result from Image query cache Pull Request resolved: https://github.com/facebook/react-native/pull/23602 Differential Revision: D14221747 Pulled By: cpojer fbshipit-source-id: 06cf08078a330e4d5731ad72010c87e9e69fcd7b
This commit is contained in:
committed by
Facebook Github Bot
parent
9a64755a18
commit
9ac219e077
@@ -157,7 +157,7 @@ function abortPrefetch(requestId: number) {
|
||||
*/
|
||||
async function queryCache(
|
||||
urls: Array<string>,
|
||||
): Promise<Map<string, 'memory' | 'disk'>> {
|
||||
): Promise<{[string]: 'memory' | 'disk' | 'disk/memory'}> {
|
||||
return await ImageLoader.queryCache(urls);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ function prefetch(url: string) {
|
||||
|
||||
async function queryCache(
|
||||
urls: Array<string>,
|
||||
): Promise<Map<string, 'memory' | 'disk' | 'disk/memory'>> {
|
||||
): Promise<{[string]: 'memory' | 'disk' | 'disk/memory'}> {
|
||||
return await ImageViewManager.queryCache(urls);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ class NetworkImageCallbackExample extends React.Component<
|
||||
`✔ Prefetch OK (+${new Date() - mountTime}ms)`,
|
||||
);
|
||||
Image.queryCache([IMAGE_PREFETCH_URL]).then(map => {
|
||||
const result = map.get(IMAGE_PREFETCH_URL);
|
||||
const result = map[IMAGE_PREFETCH_URL];
|
||||
if (result) {
|
||||
this._loadEventFired(
|
||||
`✔ queryCache "${result}" (+${new Date() -
|
||||
|
||||
Reference in New Issue
Block a user