Skip to content

Instantly share code, notes, and snippets.

@carbide-public
Created March 11, 2019 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carbide-public/9b57f3f29511ebda9564098e5e6f90bf to your computer and use it in GitHub Desktop.
Save carbide-public/9b57f3f29511ebda9564098e5e6f90bf to your computer and use it in GitHub Desktop.
untitled
const cloneActionWithUser = (action, user) => {
const thunk = action.call({})
thunk.user = user;
return (a) => {
return thunk
}
}
const user = {token: 123 }
const test = (model) => {
console.log(arguments[0])
return function (dispatch, getState, API) {
console.log(dispatch, getState, API)
}
}
const t = cloneActionWithUser(test, user)
const model = { fds: 123 }
t(model)('1','2','3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment