If we get data through events, what's the advantage of swr
I'm not sure what does "in the first fetch" mean, could you explain?
As for the second question, if you use event emitter to handle data fetching, you'll have to do more work to:
For complex web apps, e.g.: say a page with 100 component instances, both of them require the data of some API, how can you make sure:
If you try to simplify those processes with hooks, it will probably result in something similar to swr at the end.
Meanwhile, I'm working on a complex, real world SWR example too.
Let me know if you have any further questions!
Most helpful comment
I'm not sure what does "in the first fetch" mean, could you explain?
As for the second question, if you use event emitter to handle data fetching, you'll have to do more work to:
For complex web apps, e.g.: say a page with 100 component instances, both of them require the data of some API, how can you make sure:
If you try to simplify those processes with hooks, it will probably result in something similar to swr at the end.
Meanwhile, I'm working on a complex, real world SWR example too.