Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
For real though, I wish I knew why somebody came out with this name. But jokes aside, thunks are the thing that at some point made me wondering how I had got so far with JavaScript without even knowing how powerful it can be. From a synchronous perspective, thunk is essentially a function that is ready to give you some value back and requires no additional input. As simple as that. Many of you working with React probably know an awesome and plain simple library called redux-thunk which as name suggests is based on thunks. But more on that later. For now let's take a look at a simple example of a synchronous thunk: