Blame view
imports/client/views/org/admin/app/Index.js
1.26 KB
d532f2f02
|
1 |
// import { AppModule } from '/imports/client/views/app/module/index' |
c4d3e07d0
|
2 3 4 5 6 |
import { composeWithTracker, compose, composeAll } from 'react-komposer'; |
d532f2f02
|
7 |
import { AdminAppLayout } from './AdminLayout'; |
c4d3e07d0
|
8 |
import { Loading } from '/imports/client/components/Loading'; |
48c0461d6
|
9 |
|
c4d3e07d0
|
10 |
import { Users } from '/imports/collections/users/index'; |
d532f2f02
|
11 |
import { Orgs } from '/imports/collections/orgs/index'; |
48c0461d6
|
12 |
|
c4d3e07d0
|
13 14 15 16 |
const meteorTick = (props, onData) => { const handles = [ |
d0099dd88
|
17 |
Meteor.subscribe('users.current'), |
d532f2f02
|
18 19 20 |
Meteor.subscribe('orgs.current'), Meteor.subscribe('users.forMyOrg'), Meteor.subscribe('student.forMyOrg'), |
c4d3e07d0
|
21 22 23 24 |
]; if(_.every(handles, (handle) => (handle.ready()) )) { const user = Users.current(); |
d0099dd88
|
25 |
const org = Orgs.current(); |
c4d3e07d0
|
26 27 28 |
onData(null, { data: { user: user, |
d532f2f02
|
29 |
org: org, |
c4d3e07d0
|
30 31 32 33 34 35 36 37 38 39 40 41 |
}, }); } return () => { _.each(handles, (handle) => handle.stop() ); }; }; const reduxTick = (props, onData) => { onData(null, { |
d532f2f02
|
42 |
location: props.location, |
c4d3e07d0
|
43 44 45 |
data: {} }); }; |
d532f2f02
|
46 |
export const AdminModule = composeAll( |
c4d3e07d0
|
47 48 |
composeWithTracker(meteorTick, Loading), compose(reduxTick, Loading), |
d532f2f02
|
49 |
)(AdminAppLayout); |