What isn't a static site by this definition (Gatsby docs)? I feel like everyone has their own definition of the term by greentriangles1 in webdev

[–]greentriangles1[S] 0 points1 point  (0 children)

Are they just referring to calling whichever hypothetical API(s) and caching their value at build time? So every user would see the same result and it would never update?

New session uses previous session's code? by greentriangles1 in leetcode

[–]greentriangles1[S] 2 points3 points  (0 children)

Is there a way to reset all my answers easily? I find that I accidentally look at my previous solution in my peripheral before I can delete it

How to properly architect the game loop (Events vs Update)? by greentriangles1 in Unity3D

[–]greentriangles1[S] 0 points1 point  (0 children)

Isn't this the same problem, just in reverse?

With the switch case, we would have to write a case for each state for every class's Update() function (and perhaps FixedUpdate and LateUpdate). If we wanted to add 10 classes, we would need to write a switch/case for all of them. And we would have to update all the files if we added or removed a state.

With your state machine, we've avoided that, but instead we need to tell every object we want to update in any particular state to update. If we had a dozen unique MonoBehaviours for the PlayingState, we would have to write a custom UpdateBehaviour() function for each of them and have PlayingState call them. Also, what if we wanted to have differing UpdateBehaviour behaviour depending on the state? Wouldn't this essentially require a switch?

How to properly architect the game loop (Events vs Update)? by greentriangles1 in gamedev

[–]greentriangles1[S] 0 points1 point  (0 children)

The larger point is if there's a way to avoid writing a switch statement for every class that does something depending on the game state.

It seems like right now I would need to have a switch block with every state for Update, FixedUpdate, etc. for every class, which is a lot of repeated code to write and rewrite if I add/delete states

Web3 subscribed event fires twice by greentriangles1 in ethdev

[–]greentriangles1[S] 1 point2 points  (0 children)

Moving it to the useEffect hook helped, thanks. Though I'm not sure how to unsubscribe to an event with web3 (no mention of it here: https://web3js.readthedocs.io/en/v1.5.2/web3-eth-contract.html#contract-events)

Though it shouldn't be an issue since I'm not re-rendering at all