hippofish/src/web/app/common/mixins/i.js

21 lines
338 B
JavaScript
Raw Normal View History

2017-03-18 12:05:11 +01:00
import * as riot from 'riot';
2017-02-18 08:42:41 +01:00
2017-03-18 12:05:11 +01:00
export default me => {
2017-02-18 08:42:41 +01:00
riot.mixin('i', {
2017-02-18 23:14:07 +01:00
init: function() {
2017-02-18 08:42:41 +01:00
this.I = me;
this.SIGNIN = me != null;
if (this.SIGNIN) {
this.on('mount', () => {
me.on('updated', this.update);
});
this.on('unmount', () => {
me.off('updated', this.update);
});
}
},
me: me
});
};