Persist frontend theme preference
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace RolemasterDb.App.Frontend.AppState;
|
||||
|
||||
public sealed class BrowserStorageService(IJSRuntime jsRuntime)
|
||||
{
|
||||
public ValueTask<string?> GetItemAsync(string key) =>
|
||||
jsRuntime.InvokeAsync<string?>("localStorage.getItem", key);
|
||||
|
||||
public ValueTask SetItemAsync(string key, string value) =>
|
||||
jsRuntime.InvokeVoidAsync("localStorage.setItem", key, value);
|
||||
}
|
||||
Reference in New Issue
Block a user