reflux / refluxjs

A simple library for uni-directional dataflow application architecture with React extensions inspired by Flux
BSD 3-Clause "New" or "Revised" License
5.36k stars 330 forks source link

createActions works incorrectly with Action Definitions array #526

Open BooleT37 opened 7 years ago

BooleT37 commented 7 years ago

When using reflux.createActions with following syntax: var Actions = Reflux.createActions([{ actionName: "action1", sync: false }, { actionName: "action2", sync: false }, { actionName: "action3", asyncResult: true }]); it works incorrectly.

Given my example, I expect to get an object { action1, action2, action3 }.

But instead I get an object { actionName, asyncResult, sync }

Screenshot: screenshot

Seems like it considers every array item to be an object with action names as properties instead of action definitions therefore we get this wrong behavior.

I am using reflux 6.4.1