Skip to content

Instantly share code, notes, and snippets.

View LBWright's full-sized avatar

Logan Wright LBWright

  • Houston, TX
View GitHub Profile
@LBWright
LBWright / thunks for zach
Created September 30, 2019 13:15
thunk for zach
// inside of my actions.js, my actions look like this...
// because I'm creating a function that returns a function, I have access to dispatch
// through the Thunk middleware. I technically have access to state too, as a second argument
// Because I'm using dispatch here, this specific function can be bound to the redux store
// You could maybe think about it like a singleton?
export const createWellsTask = ({ serverId }) => async (dispatch) => {
const payload = {
properties: {
operation: 'list_wells',