What the THUNK? Using and understanding Thunk in your React/Redux app.

me: 14 months ago (mentally)
export const addToCollection = (item) => ({type: ADD_COLLECT, payload: item})
export const itemReducer = (state = INITIAL_STATE, action) => {
switch(action.type) {
case ADD_COLLECT:
return {...state, myCollection:
[...state.myCollection, action.payload]}
We want the Thunk. We gotta have that Thunk, now.
now to render all my Games…..
voila

--

--

--

Current Software Engineer student at Flatiron School, 11 year Math Teacher, 20 year thespian.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Migrating from JavaScript to TypeScript (from scratch)

The Javascript ES6 has Introduce teo New data Structures ,they are

Break your app into boxes!

JS Modules

Functional Redux — No More Switch Statements

Avoid Namespace Clashes with Directives

How to use React-Leaflet

Reading Humongous Files in Go

33 Javascript Concepts — #13. Class

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ryan Bollettino

Ryan Bollettino

Current Software Engineer student at Flatiron School, 11 year Math Teacher, 20 year thespian.

More from Medium

How to Convert Your Modern Space Using a Vintage Art Form

Apathy in Paris

Top 10 Uber Clone Script in 2022 for your Ride-Hailing Venture

Accelerating Your Web Application With Redis