meteor-collection-timestampable
meteor-collection-timestampable copied to clipboard
Create fields on client-side as well
I guess createdAt & createdBy weren't created client-side to avoid data manipulation, but hooks are ran client and server side, like methods, so datas can't be corrupted (if so, server side will insert correct datas and sync all clients with them).
Not having these two fields client-side created some glitches and I had to test if they were present. For example, I couldn't display a comment's author username before server sync. More code for me, weaker experience for users.
That said, I may have misunderstood why you did this though! :)
I believe it was so that one could manually set the createdBy
and createdAt
on creation but I'll have to look it over.