These are chat archives for reflux/refluxjs

4th
Jun 2015
Nguyen Huy Cuong
@ciminuv
Jun 04 2015 18:12
anyone here?
Eric Eastwood
@MadLittleMods
Jun 04 2015 18:13
@ciminuv Just ask, don't ask to ask
Nguyen Huy Cuong
@ciminuv
Jun 04 2015 18:14
How can i create Actions, one of them have children?
Something like this:
CommentActions = Reflux.createActions([
  'voteUp', 'voteDown', 'readMore', 'toggleThreadedComments', 'fetchChildComments', 'fetchComments', 'addChildComment', {
    'deleteComment': {
      asyncResult: true,
      children: ['pre']
    }
  }, 'updateComment'
]);
But it seem like deleteComment is not exist :(
Eric Eastwood
@MadLittleMods
Jun 04 2015 18:19
@ciminuv I am not experienced with using reflux but I think you can pass an array or an object of actions: https://github.com/spoike/refluxjs#listenables-and-asynchronous-actions
I can't find an example of putting an object in the passed array
Nguyen Huy Cuong
@ciminuv
Jun 04 2015 18:24
I tried it but no luck :(
Even the one in README
var Actions = Reflux.createActions({
    "load": {children: ["completed","failed"]}
});
It not create nomal methods load, loadCompleted, loadFailed for calling later.
Or maybe am I missunderstand something?
For ex :
AAA = Reflux.createActions(['load']);
Then when I wanna trigger load, I can call AAA.load()
Nguyen Huy Cuong
@ciminuv
Jun 04 2015 18:36

For now I will create Actions like this:

this.AAA = Reflux.createActions(['deleteComment', 'preDeleteComment', 'completedDeleteComment', 'failedDeleteComment']);

It works like what I want but… still trying to figure It out the children way.