Skip to content

Commit f12d749

Browse files
committed
Make LocalStorage API ValueTask
1 parent 84bfc2e commit f12d749

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

LinkDotNet.Blog.Web/Shared/Services/ILocalStorageService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace LinkDotNet.Blog.Web.Shared.Services;
44

55
public interface ILocalStorageService
66
{
7-
Task<bool> ContainKeyAsync(string key);
7+
ValueTask<bool> ContainKeyAsync(string key);
88

9-
Task<T> GetItemAsync<T>(string key);
9+
ValueTask<T> GetItemAsync<T>(string key);
1010

11-
Task SetItemAsync<T>(string key, T value);
11+
ValueTask SetItemAsync<T>(string key, T value);
1212
}

LinkDotNet.Blog.Web/Shared/Services/LocalStorageService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ public LocalStorageService(ProtectedLocalStorage localStorage)
1212
this.localStorage = localStorage;
1313
}
1414

15-
public async Task<bool> ContainKeyAsync(string key)
15+
public async ValueTask<bool> ContainKeyAsync(string key)
1616
{
1717
return (await localStorage.GetAsync<object>(key)).Success;
1818
}
1919

20-
public async Task<T> GetItemAsync<T>(string key)
20+
public async ValueTask<T> GetItemAsync<T>(string key)
2121
{
2222
return (await localStorage.GetAsync<T>(key)).Value;
2323
}
2424

25-
public async Task SetItemAsync<T>(string key, T value)
25+
public async ValueTask SetItemAsync<T>(string key, T value)
2626
{
2727
await localStorage.SetAsync(key, value);
2828
}

0 commit comments

Comments
 (0)