reactjs - Redux ajax workflow with prelogic -
i'm writing restful redux/react app. desired output such.
input_change--> (state = {valid: false})->reducer->(state = {valid: true})--> ajax call
from redux documentation, async javacript supposed called action creator, don't understand how action creator once state changes valid:false valid:true.
since react app, change hidden input called valid, has onchange action creator attached it, seems unneccessary step. ideas?
my general preference have action creators handle async operations. validation operation in question comparable shouldfetchposts
function in http://rackt.org/redux/docs/advanced/asyncactions.html
the action creator inputchangeandsubmitifvalid
corresponds file's fetchifneeded
action creator.
on rare occasions implement observer catching store changes, try find better action oriented way first.
Comments
Post a Comment