flux icon indicating copy to clipboard operation
flux copied to clipboard

Server/view action dispatch methods

Open rileytomasek opened this issue 11 years ago • 6 comments

Why do server and view actions have separate dispatch methods in the examples, without ever providing any inherent value. It seems like this could easily be done by just passing an extra property on the action instead. Am I missing something here or should this separation be removed?

rileytomasek avatar Dec 23 '14 00:12 rileytomasek

@fisherwebdev I see that you just updated the todo example to address this issue. Would you like me to open a PR doing this for the chat example?

rileytomasek avatar Jan 06 '15 23:01 rileytomasek

Hi @RileyTomasek that would be great. Been meaning to get to this for a long time. I'm actively working on the Flux repo / site this week, so if there is any delay just let me know, and I'll take it on myself. Thanks!

fisherwebdev avatar Jan 06 '15 23:01 fisherwebdev

@fisherwebdev I will try to get to it tomorrow. It should be pretty fast.

Did you see my PR that was also for the chat example? (#120)

rileytomasek avatar Jan 07 '15 00:01 rileytomasek

I thought it was separate because you could use the same action both for view and server event, and do something different in both cases. But for sure it didn't make sense to have it in the todo example as there is no server api.

tleunen avatar Jan 07 '15 00:01 tleunen

@tleunen If you need to use the same action, you can just add a property to the action denoting the origin and use that as a flag in the stores to handle the action differently.

fisherwebdev avatar Jan 09 '15 18:01 fisherwebdev

This was taken care of in #172 by @jarsbe.

fisherwebdev avatar Mar 07 '15 07:03 fisherwebdev