You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current mantra spec, it is recommended to define the methods in the server and then again to define a method stub in the client to benefit from the optimistic UI. But this results in a lot of code replication.
Wouldn't be better to define the methods in lib or common code as it is suggested by the guide?
The text was updated successfully, but these errors were encountered:
I put my methods in the lib folder for the same reason, but most of them are know wrapped in a if(Meteor.isServer), because only simple inserts or update-methods work properly on the client.
If your method needs additional data from other collections, it can get error-prone on the client, because you might not have subscribed to the additional data.
But with mdg:validated-methods, you want to share at least the validate-function, so I am thinking about writing a mixin for mdg:validated-methods that introduces a runClient and runServer-method, so that you can separate them more easily, while still having both in the same place (in /libs)
In the current mantra spec, it is recommended to define the methods in the server and then again to define a method stub in the client to benefit from the optimistic UI. But this results in a lot of code replication.
Wouldn't be better to define the methods in
lib
or common code as it is suggested by the guide?The text was updated successfully, but these errors were encountered: