なんかもうめっちゃ変えた
This commit is contained in:
parent
f8dddc81e2
commit
bc9a8283c6
77 changed files with 170 additions and 165 deletions
|
|
@ -2,7 +2,7 @@ import * as riot from 'riot';
|
|||
import api from '../scripts/api';
|
||||
|
||||
export default me => {
|
||||
riot.mixin('api', {
|
||||
(riot as any).mixin('api', {
|
||||
api: api.bind(null, me ? me.token : null)
|
||||
});
|
||||
};
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import * as riot from 'riot';
|
||||
|
||||
export default me => {
|
||||
riot.mixin('i', {
|
||||
(riot as any).mixin('i', {
|
||||
init: function() {
|
||||
this.I = me;
|
||||
this.SIGNIN = me != null;
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import * as riot from 'riot';
|
||||
|
||||
import activateMe from './i';
|
||||
import activateApi from './api';
|
||||
|
||||
export default (me, stream, serverStreamManager) => {
|
||||
activateMe(me);
|
||||
activateApi(me);
|
||||
|
||||
riot.mixin('stream', { stream });
|
||||
|
||||
riot.mixin('server-stream', { serverStream: serverStreamManager });
|
||||
};
|
||||
14
src/web/app/common/mixins/index.ts
Normal file
14
src/web/app/common/mixins/index.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import * as riot from 'riot';
|
||||
|
||||
import activateMe from './i';
|
||||
import activateApi from './api';
|
||||
import ServerStreamManager from '../scripts/server-stream-manager';
|
||||
|
||||
export default (me, stream) => {
|
||||
activateMe(me);
|
||||
activateApi(me);
|
||||
|
||||
(riot as any).mixin('stream', { stream });
|
||||
|
||||
(riot as any).mixin('server-stream', { serverStream: new ServerStreamManager() });
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue