0xgeert / flux-test

2 stars 0 forks source link

batch server actions on client #37

Open 0xgeert opened 10 years ago

0xgeert commented 10 years ago

If received actions have a batch object with props: size and cur this would make batching pretty easy. There needs to be a timeout though

0xgeert commented 10 years ago

upstream: https://github.com/balderdashy/sails/issues/1815

0xgeert commented 10 years ago

Circumvented inability of upstream sailsJS to pass custom options:

   __batch: {
    batchid: batchid,
    size: size
}

Therefore we pass it in obj.previous. This has no influence on potential cascade callspublishAdd/remove which are potentially performed when calling publishDestroy/publishUpdate .

Lastly, __batch is cleaned from obj.previous before passing it to the dispatcher

0xgeert commented 10 years ago

Note that you can override publishUpdate on a per-model basis by declaring it in your model class file, or for all models by declaring it in config/models.js