summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/i.ls
blob: 5f3c016f8a2a727a8ba42ea6af048665552e4e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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