Closed wizonesolutions closed 9 years ago
Good catch! I just updated the readme. It should be 'mgen publish post:userPost'. This reminds me... I need to look into the command lib and see if I can throw the help screen if a command isn't found.
Thanks! :beers:
Cool. Does publish
also subscribe to the publication, or is that not in meteor-generate
yet?
I thought about adding that but I'm not sure what the most universal pattern is.
A lesson learned in blonk is that you need to unsubscribe from them as soon as possible to keep things fast, so subscribing at startup is expensive.
Currently there are commented out subscriptions in the index, show and edit controllers that use posts and post subscriptions. This way IR can cleanup the sub when changing routes, and FastRender can be used to cache those if it's going to be reused soon.
This pattern seems to be the fastest on the client and server both.
Huh, OK. So subscribing in the waitOn
is actually generally best? Noted.
Yep in general. However using subscriptions
also works... its the same but will not wait, the route will just re-run again once the data comes in. Also recently in 1.0.4 they added template level subscriptions which automatically unsubscribe before the templates are destroyed (to prevent leaks).. I haven't tried this yet but it makes a lot of sense for "component" level stuff (for instance a weather widget that could be on any page).
It just noops; is it not actually written, but just documented in the README? It doesn't even give an error.