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);
}
