Skip to content

Commit 9d724b0

Browse files
authored
Switch to returning tasks over awaiting them
2 parents 2bd1221 + 0e133be commit 9d724b0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Blazored.LocalStorage/LocalStorageService.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,29 @@ public async ValueTask<T> GetItemAsync<T>(string key)
6565
}
6666
}
6767

68-
public async ValueTask<string> GetItemAsStringAsync(string key)
68+
public ValueTask<string> GetItemAsStringAsync(string key)
6969
{
7070
if (string.IsNullOrEmpty(key))
7171
throw new ArgumentNullException(nameof(key));
7272

73-
return await _jSRuntime.InvokeAsync<string>("localStorage.getItem", key).ConfigureAwait(false);
73+
return _jSRuntime.InvokeAsync<string>("localStorage.getItem", key);
7474
}
7575

76-
public async ValueTask RemoveItemAsync(string key)
76+
public ValueTask RemoveItemAsync(string key)
7777
{
7878
if (string.IsNullOrEmpty(key))
7979
throw new ArgumentNullException(nameof(key));
8080

81-
await _jSRuntime.InvokeVoidAsync("localStorage.removeItem", key).ConfigureAwait(false);
81+
return _jSRuntime.InvokeVoidAsync("localStorage.removeItem", key);
8282
}
8383

84-
public async ValueTask ClearAsync() => await _jSRuntime.InvokeVoidAsync("localStorage.clear").ConfigureAwait(false);
84+
public ValueTask ClearAsync() => _jSRuntime.InvokeVoidAsync("localStorage.clear");
8585

86-
public async ValueTask<int> LengthAsync() => await _jSRuntime.InvokeAsync<int>("eval", "localStorage.length").ConfigureAwait(false);
86+
public ValueTask<int> LengthAsync() => _jSRuntime.InvokeAsync<int>("eval", "localStorage.length");
8787

88-
public async ValueTask<string> KeyAsync(int index) => await _jSRuntime.InvokeAsync<string>("localStorage.key", index).ConfigureAwait(false);
88+
public ValueTask<string> KeyAsync(int index) => _jSRuntime.InvokeAsync<string>("localStorage.key", index);
8989

90-
public async ValueTask<bool> ContainKeyAsync(string key) => await _jSRuntime.InvokeAsync<bool>("localStorage.hasOwnProperty", key).ConfigureAwait(false);
90+
public ValueTask<bool> ContainKeyAsync(string key) => _jSRuntime.InvokeAsync<bool>("localStorage.hasOwnProperty", key);
9191

9292
public void SetItem<T>(string key, T data)
9393
{
@@ -138,7 +138,7 @@ public T GetItem<T>(string key)
138138
return (T)(object)serialisedData;
139139
}
140140
}
141-
141+
142142
public string GetItemAsString(string key)
143143
{
144144
if (string.IsNullOrEmpty(key))

0 commit comments

Comments
 (0)