I’m giving Mantra a test drive, and I’m liking what I see so far, but I’m not sure what the proper way to call actions from within other actions is. All the sample code I’ve seen so far has the actions just doing their own thing (i.e. comments actions only add comments and don’t touch anything else).
What if I want to chain actions together from different modules? For example (using https://github.com/mantrajs/meteor-mantra-kickstarter), when a user creates a new account, I want to also create a new post by that user. Should I just do all that within _users/actions/account.js? Or should I be calling the core/actions/posts.js action for creating a post?
If it’s using core/actions/posts.js how should I use that from within _users/actions/account.js?
We could enable that, but it’s kind a ugly with semantic wise. There no other reason than that.
But, sharing it via a library function is a much better and it shows re-usability.
Ok, that’s cool, but should I import both actions I want to chain in the library function? Wouldn’t that break modularity and make it harder to test, since the dependencies aren’t being injected?