best practice for globally accessible component

I have a user object that is shared everywhere, the way I achieve this is:
inside the App components i have {name:'user', kind:'models.User'}
inside the create function, I pass the the user object to App as a static variable
App.user = this.$.user
and everywhere else I would use App.user.logout() or access the data and such

This seems slightly hacky, is there a better way?


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!