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