File tree Expand file tree Collapse file tree
Demo/ExpireStorage.Demo.PWA Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ public class StorageSettings
55 public string Key { get ; set ; } = "StorageKey" ;
66 public int LocalStorageDaysInFuture { get ; set ; } = 7 ;
77 public int SessionStorageMinutesInFuture { get ; set ; } = 10 ;
8- public int ResponseDelayInMs { get ; set ; } = 0 ;
9- public bool MockOffline { get ; set ; } = false ;
8+ public int ResponseDelayInMs { get ; set ; } = 500 ;
9+ public bool MockOffline { get ; set ; }
1010}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ private async Task Save()
3838 var value = await StorageService . CachedRequestAsync ( _storageSettings . Key ,
3939 async ( ) => await FunctionToCall ( ) ,
4040 _cachedRequest ,
41- new DemoModelForStorage ( ) ,
41+ new DemoModelForStorage { Data = "Default object returned." } ,
4242 _cls . Token ) ;
4343 _response = value ? . Data ?? "No data" ;
4444 _handledBy = value ? . HandledBy ?? HandledBy . None ;
@@ -52,16 +52,15 @@ private async Task<DemoModelForStorage> FunctionToCall()
5252 {
5353 await Task . Delay ( _storageSettings . ResponseDelayInMs ) ;
5454 }
55-
55+
5656 if ( _storageSettings . MockOffline )
5757 {
5858 throw new HttpRequestException ( "Mock offline" ) ;
5959 }
6060
6161 return _model ;
6262 }
63-
64-
63+
6564 private Task OfflineChanged ( bool newValue )
6665 {
6766 _isOffline = newValue ;
You can’t perform that action at this time.
0 commit comments