Beginner's Blazor State Management Tutorial (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ย. 2024
  • 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:
    / @luova
    Perhaps you need a bit of guidance in landing the job, passing the interview or succeeding in your Software Career? Book a session:
    contractlancer...

ความคิดเห็น • 6

  • @livb4139
    @livb4139 7 หลายเดือนก่อน +1

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

  • @andywalter7426
    @andywalter7426 2 ปีที่แล้ว +4

    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.

    • @justblazorprogramming
      @justblazorprogramming  2 ปีที่แล้ว +2

      Gotta get back to you on that, delegates are something I rarely used myself so i thought it natural to use events but it is an interesting question, dont think im ignoring you.

  • @duhantark2060
    @duhantark2060 ปีที่แล้ว +2

    Very good:)

  • @trevordennis
    @trevordennis 2 ปีที่แล้ว +1

    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 :^)

    • @justblazorprogramming
      @justblazorprogramming  2 ปีที่แล้ว

      At the end i do show you how to do that. You need to apply the value inside the lifecyle method of OnInitialize()