Build react useFetch from scratch | with check list, tests and examples

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

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

  • @brynobryno
    @brynobryno 4 วันที่ผ่านมา +9

    I would appreciate video on testing itself ✌

    • @mrlectus
      @mrlectus 23 ชั่วโมงที่ผ่านมา

      upvote this guys

  • @tnp03
    @tnp03 3 วันที่ผ่านมา

    Great video 🎉.
    1. Please add tutorials for testing.
    2. How to prefetch using this

  • @nickwoodward819
    @nickwoodward819 4 วันที่ผ่านมา

    amazing idea for a video. learning how useState worked under the hood and implementing a basic version helped me understand stale values much better. looking forward to watching all of this

  • @ElNicopewpew
    @ElNicopewpew 2 วันที่ผ่านมา

    Damn I learned so much, and it gave me a teeny bit anxiety regarding some of my old fetch functions.

  • @prashlovessamosa
    @prashlovessamosa 4 วันที่ผ่านมา

    great thanks for sharing CJ

  • @hut_fire1490
    @hut_fire1490 4 วันที่ผ่านมา +1

    Would using useReducer makes any differences here ?

    • @syntaxfm
      @syntaxfm  4 วันที่ผ่านมา +3

      Yes, we could combine all of the useStates into a single useReducer. The main difference is preference / implementation. I plan to cover this in a future video. It will be nice to show a refactor that has tests to make sure our refactor doesn't break anything.

  • @rahulspoudel
    @rahulspoudel 3 วันที่ผ่านมา

    nice one. thanks cj & syntax 👏👌

  • @cant_sleeeep
    @cant_sleeeep 4 วันที่ผ่านมา

    amazing person

  • @nicogaspa1021
    @nicogaspa1021 3 วันที่ผ่านมา

    Nice job! Thanks CJ for the great content as always 😊✌🏻

  • @elmalleable
    @elmalleable 4 วันที่ผ่านมา

    Awesome

  • @YoussefWH
    @YoussefWH 3 วันที่ผ่านมา

    Great

  • @taquanminhlong
    @taquanminhlong 4 วันที่ผ่านมา

    I think making useAsyncState is more versatile than narrowing down to just fetching

    • @syntaxfm
      @syntaxfm  4 วันที่ผ่านมา

      That would be a fun one to implement as well. The main use case for something like useFetch is built in request cancellation and error handling.

  • @hut_fire1490
    @hut_fire1490 4 วันที่ผ่านมา +2

    Maybe implement cache as well for future video ? That would be interesting

  • @mrlectus
    @mrlectus 23 ชั่วโมงที่ผ่านมา

    Now use useReducer