跳到主要内容

bn.getBackgroundFetchData

getBackgroundFetchData(options): Promise<GetBackgroundFetchDataResult>

description Get backgroundFetch cache. If current request is still ongoing this api will return previous cache. If no cache at all this api will reject.

example

const { 
fetchedData,
timeStamp,
errMsg,
path,
query,
scene
} = bn.getBackgroundFetchData({ fetchType: 'pre' })

Parameters

NameType
optionsGetFetchDataOptions

Returns

Promise<GetBackgroundFetchDataResult>


GetFetchDataOptions

Ƭ GetFetchDataOptions: Object

Type declaration

NameTypeDescription
fetchType"periodic" | "pre"Cache data category, with a value of periodic or pre

Interface: GetBackgroundFetchDataResult

NameTypeDescription
fetchedDatastringCache data
timeStampnumberThe timestamp of client getting the cached data
errMsgstringError message if there's an error
path?stringThe route path of mini program
query?stringThe query data passed to the page
scene?numberScene value of entering page