This Gist was automatically created by Carbide, a free online programming environment.
Created
March 11, 2019 22:31
-
-
Save carbide-public/9b57f3f29511ebda9564098e5e6f90bf to your computer and use it in GitHub Desktop.
untitled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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