Offline Storage in Blazor WebAssembly

preview_player
Показать описание
Blazor WebAssembly applications allow us to create offline-capable web applications in C#. But that raises the question of how we store data locally so that the application can continue to function while offline. In this lesson, we are going to utilize LocalStorage to store data from a Blazor WebAssembly application.

Рекомендации по теме
Комментарии
Автор

Very easy to follow, I got it working on my local IIS and on Android phone within a few minutes. Thanks.

yt
Автор

very useful for store user state... shopping cart, list of user's stuff...

Автор

Kind of useful, but it would be better if there was an AppBrowser that could write to client drive.

markallan
Автор

Great video! Do you have anything on authentication in an offline Blazor App? What kind of strategy should be used?

ovnydev
Автор

good job
what is the difrint between localstorge and indexdb
if id need show list from todos by where ToDoItem like '%fourth%'
i can do this conditon

abhaq
Автор

What would be the best way to sync that data to remote data storage when the user reconnects to the internet?

caillinspain
Автор

Thanks Tim.

Just to say, that dependency warning was not present for me, so I suppose its been fixed already.

Susandwyer
Автор

I don't think I heard you mention this, but browsers only allow a 5MB maximum of data to be stored in local storage per origin. Same for session storage. I'm not sure if you get more space after installing as a PWA but I didn't find anything on it. The other storage systems: IndexedDB, Cache API, and File System API seem to get more space, but every browser sets their own limits based on your hard drive size.

trevordennis
Автор

Is there a compelling reason for using Blazored/LocalStorage instead of just doing it directly?

I mean,
Why not just do

await JS.InvokeVoidAsync("localStorage.setItem", key, value);
versus
await localStorage.SetItemAsync(key, value)

?

timclark
Автор

Is it a good practice to use async in your get and set if you're only interacting with local storage?
Anyway, thanks for the video

JohnMarsing
Автор

Why would you do this in Blazor / WebAssembly? if you're going to be doing things locally and using local storage, wouldn't it be easier and more straight forward to use WinUI or WPF? I don't understand why you would want to go through all this instead of just using a platform designed to work natively. What am I missing here?

SteveC-tt
join shbcf.ru