Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { composeWithTracker } from 'react-komposer'
import TopogramList from './TopogramList.jsx'
import { Topograms } from '../../../api/collections.js'
import { Meteor } from 'meteor/meteor'
function composer(props, onData) {
const handle = Meteor.subscribe('topograms.private')
if (handle.ready()) {
const topograms = Topograms.find({ }, { 'sort': { 'createdAt': -1 } }).fetch()
onData(null, { topograms }) // args: err, topograms, editable
}
}
export default composeWithTracker(composer)(TopogramList)
import { composeWithTracker } from 'react-komposer'
import TopogramList from './TopogramList.jsx'
import { Topograms } from '../../../api/collections.js'
function composer(props, onData) {
const handle = Meteor.subscribe('topograms.public')
if (handle.ready()) {
const topograms = Topograms.find({ 'sharedPublic': true }, { 'sort': { 'createdAt': 1 } }).fetch()
console.log(topograms)
onData(null, { topograms })
}
}
export default composeWithTracker(composer)(TopogramList)
if (typeof options === 'function') {
expandedOptions = {
getMeteorData: options,
};
}
const {
getMeteorData,
loadingComponent = null,
errorComponent = null,
pure = true,
} = expandedOptions;
const compose = (props, onData) => onData(null, getMeteorData(props));
return composeWithTracker(
compose,
loadingComponent,
errorComponent,
{ pure }
)(Component);
}
if (typeof options === 'function') {
options = {
getMeteorData: options
}
}
const {
getMeteorData,
loadingComponent = null,
errorComponent = null,
pure = true
} = options;
const compose = (props, onData) => onData(null, getMeteorData(props));
return composeWithTracker(
compose,
loadingComponent,
errorComponent,
{ pure }
)(Component);
}
return Trackr.autorun(() => {
_meteorDataDep.depend();
trackerCleanup = reactiveFn(props, onData);
});
});
return () => {
if (typeof trackerCleanup === 'function') {
trackerCleanup();
}
Data.offChange(_meteorDataChangedCallback);
return handler.stop();
};
};
return compose(onPropsChange, L, E, options);
}
import { Meteor } from 'meteor/meteor';
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import MainLayout from '../components/MainLayout';
function composer(props, onData) {
onData(null, {
loggedIn: !!Meteor.user(),
loggingIn: Meteor.loggingIn(),
});
}
export default compose(getTrackerLoader(composer), composerOptions({}))(MainLayout);
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import { Form } from '../components';
function composer({ form }, onData) {
onData(null, {
form,
});
}
export default compose(getTrackerLoader(composer), composerOptions({ spinner: true }))(Form);
import { Meteor } from 'meteor/meteor';
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import QuickNavigation from '../components/QuickNavigation';
function composer(props, onData) {
const handler = Meteor.subscribe('notifications.unreadCount');
if (handler.ready()) {
const unreadCount = 0;
onData(null, { unreadCount });
}
}
export default compose(getTrackerLoader(composer), composerOptions({}))(QuickNavigation);
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import { BrandForm } from '../components';
function composer({ brand }, onData) {
onData(null, {
brand,
});
}
export default compose(getTrackerLoader(composer), composerOptions({ spinner: true }))(BrandForm);
import { composeWithTracker } from 'react-komposer';
import { Meteor } from 'meteor/meteor';
import { AppNavigation } from '../components/app-navigation';
const composer = (props, onData) => {
onData(null, { hasUser: Meteor.user() });
};
export default composeWithTracker(composer, {}, {}, { pure: false })(AppNavigation);