Why would you use a thunk instead of just returning the function you want to call?
Why would you use a thunk instead of just returning the function you want to call?
Other urls found in this thread:
github.com
en.wikipedia.org
twitter.com
Sorry I don't speak programmer.
wtf is a thunk?
I got bait and switched into doing a web dev job and my boss kept going on about why we "NEEDED" thunks and how I was just a junior so I didn't get it, the entire thing seemed like massive typical webdev overengineering callback hell.
nakadashi
I dont even know what that is, never heard of it
Why do you keep posting her she's not even hot
what if the function needs parameters
>"she's not even hot"
You need to be institutionalized.
>thunk
explain pls I don't speak zoomer webshittery
It's sarcasm, user-you fell for the bait.
It's not sarcasm she's like a 5/10 or somewhere in that range
Redux framework trash
Better question is why would you even use redux to begin with. Redux directly contradicts with React's architecture. React normally allows you to store state variables in each component, but with Redux forces you to make everything global, so instead of encapsulation you get a singleton that stores 1000s of variables.
Imagine being so webdev-brained you think Redux invented thunks. Fuck off, retards
>returning the function you want to call
That's what a thunk is
jmp thunk
thunk:
cmove rax, some_function
cmovne rax, other_function
mov rdi, end
jmp function
some_function:
xor ecx, ecx
jmp rdi
other_function:
xor edx, edx
jmp rdi
function:
xor ebx, ebx
jump rax
end:
Thunks are good in assembly, especially for writing modular code.
If you extend the tail calls to memory space, you can pretty easily create state machines.
At that point, you are writing thunks that thunk other thunks.
Link to wikipedia for those too lazy to look it up.
en.wikipedia.org
ghc compiler exclusively uses thunks to represent all objects in memory.
basically everything whether it's a function, a number, a string is an unevaluated thunk in memory at first, until it's visited for the first time. then it substitutes in place with the result.
nakadashi
who the fuck is that even