Closed
Description
I have some example on fluce:
function authFormSubmit(fluce) {
const {valid, disabled, data: {username, password}} = fluce.stores.authForm
if (disabled) return
if (!valid) {
fluce.dispatch(AUTH_FORM_ERROR, new Error('Form is invalid'))
return
}
fluce.dispatch(AUTH_FORM_DISABLED, true)
fluce.dispatch(AUTH_FORM_ERROR, null)
authorize({username, password})
.then(
user => fluce.dispatch(CURRENT_USER, user),
error => fluce.dispatch(AUTH_FORM_ERROR, error)
)
.then(
() => fluce.dispatch(AUTH_FORM_DISABLED, false)
);
}
How to implement same action creator in redux? Should I create action creator for every action type?
Metadata
Metadata
Assignees
Labels
No labels