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