UseReducer instead of Redux (With Typescipt) [2021]

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024
  • Who needs Redux?
    Repo: github.com/joe...
    Music by: Tesko / prod. THXMOS
    #react #hooks #redux

Комментарии • 37

  • @hectorserrano9314
    @hectorserrano9314 3 года назад +2

    Brother, your last video helped me a lot, the one I commented "why hasn't this video blown up" and I used the same scaffolding and code structure for a project and was congratulated at work.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад +1

      That's awesome man! That's the whole point of this, just to help people. If one day the channel blows up, cool. If not, helping people is more than enough for me.

    • @hectorserrano9314
      @hectorserrano9314 3 года назад +2

      @@TheNerdyCanuck I'm building a Marvel App as I'm applying to a job and that's part of the technical test. The tech interview went well 😊. The thing is I've used a lot of good practices from your videos, specifically the react ones.
      It's gotta be a great feeling when you find out you've impacted other people's lives positively. Thank you so much.
      Happy to show you my app btw, we should link up 😊

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад

      You got a link to the project on GitHub??

    • @hectorserrano9314
      @hectorserrano9314 3 года назад

      @@TheNerdyCanuck it's in GitLab at the moment because is yet to be reviewed by the company but once the decision is made, I'll be allowed to change the remote origin to a personal repo and I'll share it.
      Maybe text me in hangouts, I could directly share it with ya or we hop on a Meet call and talk :) -- fonto.serrano@gmail.com

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад +1

      I'm down to link up on a discord in the near future! I think I'm going to make one people can come into !

  • @mateoc15
    @mateoc15 3 года назад +1

    Love this. Had to change playback speed to 0.5x (that's on me, not you!) but eventually got it. Thanks so much. Very little content out there about useContext with Typescript.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад

      No problem. More videos later this year when I'm out of the hospital :)

  • @aarondz789
    @aarondz789 2 года назад +1

    It's useful and thank you so much. Thanks from a small city.

  • @zarifakhtab5116
    @zarifakhtab5116 3 года назад +3

    Commenting for the algorithm because this is some good stuff.

  • @MaksymMinenko
    @MaksymMinenko 3 года назад +1

    Amazing content again! I'm so glad I've found your channel. :) Just please keep it up, don't get dissapointed that you don't have too many subscribers *yet*!

  • @kiquetal
    @kiquetal 3 года назад +1

    After fighting with types and redux, I'll implement this pattern,thank you Sir.

  • @MrPhduc
    @MrPhduc 3 года назад +1

    hi, Thanks for your video.
    But I am wondering that how we handle "async actions" with Context Hook? like "add_item" action, you dispatch the action, then updating data into global state.
    but if we need to handle "before" and "after" "add_item" action is handled?
    For example, with redux middleware ( thunk or saga), we can handle those like:
    // Async action processed by redux-thunk middleware
    export function fetchAllCountries() {
    return async (dispatch: Dispatch) => {
    console.log('dispatch', dispatch)
    try {
    dispatch(getCountries()) // loading: true
    const res = await fetch(`${baseURL}/all`)
    await handleErrors
    const data = await res.json()
    dispatch(getCountriesSuccess(data))
    } catch (error) {
    dispatch(getCountriesFail(error))
    }
    }
    }
    Thanks.
    Looking forward to your help.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад

      So you're asking how to add some pre a d post functions to the dispatch, or how to use async calls in the dispatch? :)

    • @MrPhduc
      @MrPhduc 3 года назад

      @@TheNerdyCanuck yes .
      thanks

  • @logconsole-s2f
    @logconsole-s2f 3 года назад +1

    Thank you for the useful information!!! I have a question. How do I code to output the total price of the two carts(coolshoe & new slippers)?If you have time, please reply.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад +1

      You would simply use a loop through the dictionary, add them to a variable for total price

  • @dennisgonzales9521
    @dennisgonzales9521 3 года назад +1

    Thank you!
    For the next video can you cover MobX?

  • @leonardo.cardoso
    @leonardo.cardoso Год назад

    Very nice!

  • @_sumitdey.exe1
    @_sumitdey.exe1 3 года назад

    Hey I have a doubt.. which initial value ultimately gets set in the context.. the value you passed inside createContext(VALUE) or the value you passed as the initial value in reducer

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 года назад

      The initial value overrides the default one in the context I believe. You need one for a placeholder for typescript

  • @slatanek
    @slatanek 3 года назад +1

    Thanks for the very informative video. My issue is how to implement it together with fetching the data from an API. Hooks just drive me crazy with their limitations and I can't get it to work cause i can't call the fetch hook where I need it. For instance I need to start with a context where an array is filled with elements fetched from an api and then on click I need to re-fetch.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад +1

      I'm working on a small project to show people how to implement it all together. Stay tuned 🙂

  • @137dylan
    @137dylan 3 года назад

    It would've been nice to have the starting code so we could code along too.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад

      The github code was in the video description.

  • @mahendranath2504
    @mahendranath2504 3 года назад +1

    nice thank , so useful , please can you do advanced MERN application service , as its having more job opportunity

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 года назад

      What kind of mern stack app?

    • @mahendranath2504
      @mahendranath2504 3 года назад

      @@TheNerdyCanuck I'm so happy about your reply to my request, can you do an app where it will have roles like (admin/user), the user (author), they create a blog, with image and it will have a comment section like youtube comment section, comments, and reply, and admin can block/unblock a user, or blog post. the post will have like/dislike, for simple understanding think like a medium where author post and people read and comment and clap(like/dislike ) and admin is the one who monitors, like deactivating the post or user account, This is what I felt because one can learn how to do role base approach and image upload and comment section, and for both node and react using typescript will be more enhance feature, even we can apply this same for the react-native learning process, Finally once again thanks for making our learning process lot easy, I know its a lot of work, you can create series of videos or you can do live coding session so that people will subscribe to the channel and ❤ your channel, I sure your channel is one of the best for programming, I appreciate your effort on screen and behind the screen, for make our learning a lot easy,

  • @sarcasticdna
    @sarcasticdna 3 года назад +1

    subscribed ❤