|
|
@ -77,7 +77,7 @@ class RequestManager { |
|
|
|
try { |
|
|
|
try { |
|
|
|
subject.add( |
|
|
|
subject.add( |
|
|
|
Result( |
|
|
|
Result( |
|
|
|
unwrap(deserialize((await cache!.get(key))!)), |
|
|
|
unwrap(await compute(deserialize, (await cache!.get(key))!)), |
|
|
|
null, |
|
|
|
null, |
|
|
|
loading: true, |
|
|
|
loading: true, |
|
|
|
cached: true, |
|
|
|
cached: true, |
|
|
@ -91,7 +91,7 @@ class RequestManager { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
final response = await (disableTimeout ? call() : timeout(call)); |
|
|
|
final response = await (disableTimeout ? call() : timeout(call)); |
|
|
|
await cache?.set(key, serialize(response)); |
|
|
|
await cache?.set(key, await compute(serialize, response)); |
|
|
|
subject.add(Result.success(unwrap(response))); |
|
|
|
subject.add(Result.success(unwrap(response))); |
|
|
|
} catch (e, s) { |
|
|
|
} catch (e, s) { |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(e.toString()); |
|
|
@ -115,7 +115,7 @@ class RequestManager { |
|
|
|
try { |
|
|
|
try { |
|
|
|
subject.add( |
|
|
|
subject.add( |
|
|
|
Result( |
|
|
|
Result( |
|
|
|
unwrap(deserialize((await cache!.get(key))!)), |
|
|
|
unwrap(await compute(deserialize, (await cache!.get(key))!)), |
|
|
|
null, |
|
|
|
null, |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
cached: true, |
|
|
|
cached: true, |
|
|
|