Beginner's Blazor State Management Tutorial (Part 2)

preview_player
Показать описание
So this video is a continuation of the last one, if you havent seen the first one then I urge you to watch it as I do use the same project from that one. In this video I discuss how pages can subscribe to the State Manager ( I use the words 'listen' as it seems like its more common to use), and then have that data available to it and also trigger the events needed in order to update that data.

Consider this a continuation I thought probably could use its own video as the first one really taught you the foundation and basics you need to do this one.

Music Credit goes to LOQUOR:

Perhaps you need a bit of guidance in landing the job, passing the interview or succeeding in your Software Career? Book a session:
Рекомендации по теме
Комментарии
Автор

I have a question. At around 8 minutes where you had event handlers, wouldn't it be better to just accept a delegate and the parent page would call into it which would call StateHasChanged?
Because I found with events, that causes many memory leaks.
I would think with delegates, there are no need for events.
Also, what is the purpose of doing EventHandler and not just create a delegate for each event you did do? The easiest way is a built in type called Action.

andywalter
Автор

this look so complicated surely there's an easier way of doing this?

livb
Автор

Does this state survive a page refresh? I built a service that stores data in a folder on my server for Blazor Server or in JS local storage for WebAssembly. I found that it is far too easy to start a page refresh on a mobile device when scrolling up. iOS browsers use a drag-down gesture to start page refreshes and I accidentally cause it all the time :^)

trevordennis