Questions tagged [thunk]

A parameterless closure (functional programming) or a function generated by a compiler to aid runtime linking with a dynamic library function.

  • In functional programming, a thunk is an anonymous and parameterless function (closure), used to pass lazily evaluated expressions.
  • In C++, a thunk is a compiler generated function which optimizes virtual function calls.
  • On systems which support dynamic linking, a thunk is often automatically inserted to provide a place for the runtime linker to insert code for invoking the actual implementation found in a library.
184 questions
-1
votes
2 answers

Redux Thunk - cascade dispatch calls

In my React Redux project, I am writing a thunk, and want it to dispatch only if the previous update if any has been completed. I'm aware that thunks are methods that help us delay dispatching actions to the reducer, and they can also be…
Divyansh Goenka
  • 997
  • 2
  • 12
  • 35
-1
votes
1 answer

Why do they call them Thunks?

A Thunk is often defined as any piece of code (usually a function) that delays the evaluation of an expression. In JavaScript, a Thunk might look like (a,b)=>a+b, but they exist in many different languages. https://en.wikipedia.org/wiki/Thunk So, my…
Code Whisperer
  • 22,959
  • 20
  • 67
  • 85
-1
votes
1 answer

Does any operating system allow an application programmer to create pointers out of thunks?

Many operating systems allow one to memory map files, and read from them lazily. If the operating system can do this then effectively it has the power to create regular pointers out of thunks. Does any operating system allow an application…
-2
votes
1 answer

can you clarify the use of thunks in redux toolkit? a few specific questions

Looks like thunk and saga are 2 types of middleware to allow side effects and asyncronous actions in Redux Toolkit. Based on some basic googling, looks like thunk and saga basically serve the same purpose. Without understanding the key differences…
user10307666
  • 151
  • 1
  • 4
  • 14
1 2 3
12
13