feat:add StoragePlugin for Android
This commit is contained in:
@@ -149,4 +149,21 @@ export function network(context: BridgeContext) {
|
||||
return context.network.request(transformRequest(finalConfig)) as Promise<IResponse>
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export function storage(context: BridgeContext) {
|
||||
return {
|
||||
setItem: (key: string, value: string, zone?: string) => {
|
||||
return context.storage.store({ key, value, zone })
|
||||
},
|
||||
getItem: (key: string, zone?: string) => {
|
||||
return context.storage.retreive({ key, zone }) as Promise<string>
|
||||
},
|
||||
remove: (key: string, zone?: string) => {
|
||||
return context.storage.remove({ key, zone })
|
||||
},
|
||||
clear: (zone: string) => {
|
||||
return context.storage.clear(zone)
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user