shuckster


























  1. I mean asyn keyword that makes that funcion asynchronous

  2. async/await makes working with Promises look "imperative".

  3. Don't hard code the board. Use a loop to build the length you need to keep it dynamic.

  4. Just how is the length of a Monopoly board "dynamic"?

  5. It's obviously not. But if you wanted to reuse the function logic or somehow alter the game it's easier than if you hard code everything. No sense reinventing the wheel every time. Using an array for a board is kind of a common pattern. So, instead of writing the same function a bunch of times and rewriting it, just make a generic function that can be reused.

  6. I must admit I don’t really follow you.

  7. Talking about being overwhelmed by options. I've never heard of Vite. What sets it apart?

  8. It’s just a very quick way to get up and running with a barebones React app so you can tinker around.

  9. I often even do await fn().catch(() => null).

  10. This is definitely very helpful, thank you very much! So then the only way to do anything with the data within a promise is to provide a callback to the promise, is that it?

  11. I’m not suggesting this be done automatically as a new web standard. I’m asking about doing it in a bootstrap, on a case by case basis.

  12. If I didn't know the API how would I know what each function does just by looking at it? Would taking an options/props object not make it a little clearer at the point-of-use?

  13. How does it deal with debouncing (stale requests) etc? Surely this hook is trivial to implement as any async task wrapping hook everyone has already made?

  14. Since use just accepts a Promise, it seems like the responsibility for SWR goes into the function that made the Promise in the first place. So I'd expect to see some helpers coming from the community to cover use-cases like this.

  15. Have hooks changed such that you can use them inside conditional logic, or is this hook special in that regard too?

  16. You can post them to this Reddit in Show-off Saturday or WTF Wednesday, make new posts about them, or just mention them in comments if you think they would be useful to someone.

  17. "Memories... light the corners of my mind..."

  18. What I observe are a whole bunch of folks who never really learned to write JavaScript. So they hand off that responsibility to a third-party program and hope for a consistent, bug-free outcome.

  19. An array can be a valid key for a Map if you don’t mind the conversion.

  20. My initial use case is this (TS):

  21. Anytime! .NET offers this as part of its Reflection library, plus a LOT more helpful things when dealing with objects and OOP based code.

  22. I've used optimal-select (same kind of thing) for a little

  23. The article explains that is a mere suggestion and that browsers can do what they like. This is correct, for example; Firefox will not prefetch anything HTTPS by default, and mobile browsers also tend to ignore the flag for bandwidth related reasons.

Leave a Reply

Your email address will not be published. Required fields are marked *

Author: admin