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);
}
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);
import { composeWithTracker } from 'react-komposer';
import { Meteor } from 'meteor/meteor';
import Documents from '../../api/documents/documents.js';
import DocumentsList from '../components/DocumentsList.js';
import Loading from '../components/Loading.js';
const composer = (params, onData) => {
const subscription = Meteor.subscribe('documents.list');
if (subscription.ready()) {
const documents = Documents.find().fetch();
onData(null, { documents });
}
};
export default composeWithTracker(composer, Loading)(DocumentsList);
import {composeWithTracker} from 'react-komposer';
import PostList from '../components/post_list.jsx';
import { DocHead } from 'meteor/kadira:dochead';
function composer(props, onData) {
const handle = Meteor.subscribe('posts');
if(handle.ready()) {
const posts = Posts.find({}, {sort: {_id: 1}}).fetch();
onData(null, {posts});
};
DocHead.setTitle('My Blog');
};
export default composeWithTracker(composer)(PostList);
const data = {
currentUser: Meteor.user(),
actions: {call: Meteor.call},
events: Events,
messages: Messages
}
if (!subscriptions.length || _.every(subscriptions, handle => handle.ready())) {
data.ready = true;
onData(null, data);
} else {
onData(null, {ready: false});
}
}
module.exports = composeWithTracker(composer);
export default composeWithTracker(composer);