Storage


How to use the Storage class of the bit Butil?

Usage
To use the browser storage features you need to inject the Bit.Butil.Storage class and use it like this:
@inject Bit.Butil.LocalStorage localStorage
@inject Bit.Butil.SessionStorage sessionStorage

@code {
    await localStorage.SetItem("my-key", "my-value");
    await sessionStorage.SetItem("my-key2", "my-value2");
}
Methods

GetLength:
Returns an integer representing the number of data items stored in the Storage object (MDN).



GetKey:
When passed a number n, this method will return the name of the nth key in the storage (MDN).



GetItem:
When passed a key name, will return that key's value (MDN).



SetItem:
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists (MDN).



RemoveItem:
When passed a key name, will remove that key from the storage (MDN).



Clear:
When invoked, will empty all keys out of the storage (MDN).