NgRx Best Practices - Folge 1: Cache & LoadStatus

Поділитися
Вставка
  • Опубліковано 13 жов 2024
  • In dieser Folge behandeln wir, wie wir eine Cachingfunktionalität einbauen können.
    GitHub Repo: github.com/rai...
    Artikel (englisch): www.rainerhahn...

КОМЕНТАРІ • 9

  • @andrups80
    @andrups80 2 роки тому +1

    Sehr spannendes Thema, Danke für das Video! Am Ende (24:46) sprichst du an, dass in einer weiteren Folge auf komplexere Caches eingegangen wird. Ist diese Folge schon erschienen (habe sie dann nicht gefunden) oder noch in der Pipeline?

    • @RainerHahnekamp
      @RainerHahnekamp  2 роки тому +1

      Hallo, ja super, dass es dir gefallen hat. Die Folge mit dem komplexen Cache ist noch nicht erschienen, aber ich werde sie wahrscheinlich nur auf englisch machen. Wenn in meinem Kanal mehrsprachige Videos sind, dann trägt das eher zur Verwirrung bei und ich denke einmal, dass man in der Softwareentwicklung sowieso englisch versteht.

    • @andrups80
      @andrups80 2 роки тому +1

      @@RainerHahnekamp Englisch ist natürlich kein Problem - ich bin gespannt!

  • @aram5642
    @aram5642 3 роки тому

    How do you solve the progress status for the remaining crud operations if you want to display spinner or disable buttons? I typically create a separate micro state for each crud operation, that property has a type of ProgressableState. It works ok but I have the feeling that it is not the best way of handling crud from the scalability perspective.

    • @RainerHahnekamp
      @RainerHahnekamp  3 роки тому

      Yeah, so in your scenario I always try to get away with an httpinterceptor and a global spinning indicator. Whenever a http request is sent, that spinner starts to show. If that is not possible, there is another possibility which I will integrate in the third episode. That would be passing a callback function into the ngrx action and it will be executed by the effect. So before the component dispatches the action, it should start with showing the loading indicator and in the action you pass a callback function, that hides the loading indicator.

    • @aram5642
      @aram5642 3 роки тому

      @@RainerHahnekamp That's going to be a super interesting episode :) Looking forward to that! Thank you!

  • @aram5642
    @aram5642 3 роки тому

    Sorry if I am asking about something that you included in your 3 comments at the end (mein Deutsch ist sehr schlecht): in real life I would like to have a boolean parameter for the get action "forceLoad", to enable user to click reload icon and refresh data, without having to reload entire web page. Or do you have another solution for that?

    • @RainerHahnekamp
      @RainerHahnekamp  3 роки тому

      Hi, please watch the English version: ua-cam.com/video/H-aSiiRFBN4/v-deo.html
      So if you want cache invalidation, then create an action resetCustomers. That action should be handled via the reducer and in the effect. The reducer sets the loadStatus property to NOT_LOADED and in the Effect, you have a ....pipe(ofType(resetCustomers()), map(CustomerActions.get()). Is that clear or do you want me to add a branch to the Git repo with it?

    • @aram5642
      @aram5642 3 роки тому

      @@RainerHahnekamp This is absolutely clear. I was just wondering about your practice :) Thank you