summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/i.ls
blob: 888ef194d0961ad19d93c6e4195b3362d39cfac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
riot = require \riot

module.exports = (me) ->
	riot.mixin \i do
		init: ->
			@I = me
			@SIGNIN = me?

			if @SIGNIN
				@on \mount   ~> me.on  \updated @update
				@on \unmount ~> me.off \updated @update

		update-i: (data) ->
			if data?
				Object.assign me, data
			me.trigger \updated

		me: me