BlazorExtensions / Storage
Licence: mit
HTML5 Storage API implementation for Microsoft Blazor
Stars: ✭ 180
Labels
Projects that are alternatives of or similar to Storage
Udisks
The UDisks project provides a daemon, tools and libraries to access and manipulate disks, storage devices and technologies.
Stars: ✭ 170 (-5.56%)
Mutual labels: storage
Serde Wasm Bindgen
Native integration of Serde with wasm-bindgen
Stars: ✭ 176 (-2.22%)
Mutual labels: webassembly
Lam
🚀 a lightweight, universal actor-model vm for writing scalable and reliable applications that run natively and on WebAssembly
Stars: ✭ 176 (-2.22%)
Mutual labels: webassembly
Carton
📦 Watcher, bundler, and test runner for your SwiftWasm apps
Stars: ✭ 171 (-5%)
Mutual labels: webassembly
Put.io Adder
OS X put.io client that acts as handler for magnet: links and .torrent files, and adds them to your put.io download queue
Stars: ✭ 172 (-4.44%)
Mutual labels: storage
Waforth
A bootstrapping dynamic Forth Interpreter/Compiler for WebAssembly
Stars: ✭ 176 (-2.22%)
Mutual labels: webassembly
Remotestorage.js
⬡ JavaScript client library for integrating remoteStorage in apps
Stars: ✭ 2,155 (+1097.22%)
Mutual labels: storage
Amplify Cli
The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Stars: ✭ 2,399 (+1232.78%)
Mutual labels: storage
Edit Text
Collaborative rich text editor for the web. Written in Rust + WebAssembly.
Stars: ✭ 171 (-5%)
Mutual labels: webassembly
Tus Ruby Server
Ruby server for tus resumable upload protocol
Stars: ✭ 172 (-4.44%)
Mutual labels: storage
Rxpaper
Reactive extension for NoSQL data storage on Android
Stars: ✭ 179 (-0.56%)
Mutual labels: storage
Maya
Manage Container Attached Storage (CAS) - Data Engines in Kubernetes
Stars: ✭ 169 (-6.11%)
Mutual labels: storage
Alchemyvm
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 176 (-2.22%)
Mutual labels: webassembly
Signalr
SignalR Core support for Microsoft ASP.NET Core Blazor
Stars: ✭ 180 (+0%)
Mutual labels: webassembly
Webassembly Examples
From Simple To Complex. A complete collection of webassembly examples.
Stars: ✭ 177 (-1.67%)
Mutual labels: webassembly
Blazor Extensions
Blazor Extensions are a set of packages with the goal of adding useful things to Blazor.
Blazor Extensions Storage
This package wraps HTML5 Storage APIs. Both Session and Local storage types are supported.
Sample configuration
Setup
The following snippet shows how to setup the storage wrapper by registering it for dependency injection in the Startup.cs
of the application.
public void ConfigureServices(IServiceCollection services)
{
// Add Blazor.Extensions.Storage
// Both ISessionStorage and ILocalStorage are registered
services.AddStorage();
}
Usage
The following snippet shows how to consume the storage API in a Blazor component.
@inject ISessionStorage sessionStorage
@inject ILocalStorage localStorage
@functions {
protected override async Task OnInitAsync()
{
var key = "forecasts";
await sessionStorage.SetItem<WeatherForecast[]>(key, forecasts);
await localStorage.SetItem<WeatherForecast[]>(key, forecasts);
var fromSession = await sessionStorage.GetItem<WeatherForecast[]>(key);
var fromLocal = await localStorage.GetItem<WeatherForecast[]>(key);
}
}
If you want to consume it outside of a cshtml
based component, then you can use the Inject
attribute to inject it into the class.
[Inject]
protected ISessionStorage sessionStorage;
[Inject]
protected ILocalStorage localStorage;
public Task LogSomething()
{
var key = "forecasts";
await sessionStorage.SetItem<WeatherForecast[]>(key, forecasts);
await localStorage.SetItem<WeatherForecast[]>(key, forecasts);
var fromSession = await sessionStorage.GetItem<WeatherForecast[]>(key);
var fromLocal = await localStorage.GetItem<WeatherForecast[]>(key);
}
Contributions and feedback
Please feel free to use the component, open issues, fix bugs or provide feedback.
Contributors
The following people are the maintainers of the Blazor Extensions projects:
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].