Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {Meteor} from 'meteor/meteor'
import {Mongo} from 'meteor/mongo'
// Observe db collection changes
Meteor.subscribe('state')
Meteor.subscribe('genres') // A map of genre-firendly-name to genre id
Meteor.subscribe('movies')
Meteor.subscribe('movieCache')
Meteor.subscribe('recent') // Recently clicked
Meteor.subscribe('watched')
const State = new Mongo.Collection('state')
const Recent = new Mongo.Collection('recent')
const Watched = new Mongo.Collection('watched')
const Movies = new Mongo.Collection('movies')
const Genres = new Mongo.Collection('genres')
// State
export const getState = () => State.findOne({_id: '0'})
export const getGenres = () => Genres.find({items: {$exists: true}}, {sort: {name: 1}}).fetch()
export const getGenreById = gid => Genres.findOne(gid)
Deps.autorun( function() {
Meteor.subscribe( "investigation-details", Session.get( 'investigationID' ), onReady = function() {
initDatePickers();
} );
Meteor.subscribe( "userActivity", onReady = function() {
//register a callback for new user activity
//to show a notify when someone enters
//screens the user is on
//only run onReady to avoid initialization 'add' messages.
cursorUserActivity = userActivity.find( {
path: 'investigation',
itemId: Session.get( 'investigationID' ),
userId: { $ne: Meteor.user().profile.email }
},
{
reactive: true
} )
.observeChanges(
{
added: function( id, fields ) {
//console.log(fields);
export default withTracker(() => {
Meteor.subscribe('resources');
Meteor.subscribe('courses');
Meteor.subscribe('filedetails');
Meteor.subscribe('references');
return {
resources: References.find({ courseId: getCourseId() }).fetch(),
resource: References.findOne({ _id: getResourceId() }),
courseName: _Courses.findOne(
{ _id: getCourseId() },
{ fields: { name: 1 } },
),
};
})(DisplayResource);
export default withTracker((props) => {
const locationsSub = Meteor.subscribe(Locations.getCollectionName());
const opqBoxesSub = Meteor.subscribe(OpqBoxes.getPublicationName());
const opqBoxes = OpqBoxes.find().fetch();
return {
ready: opqBoxesSub.ready() && locationsSub.ready(),
incident_id: Number(props.match.params.incident_id),
opqBoxes,
locations: Locations.find().fetch(),
};
})(IncidentViewer);
export default ThirtyFourContainer = withTracker((props) => {
const chartHandle = Meteor.subscribe('vpDistribution.latest');
const loading = !chartHandle.ready();
const stats = VPDistributions.findOne({});
const statsExist = !loading && !!stats;
return {
loading,
statsExist,
stats: statsExist ? stats : {}
};
})(ThirtyFour);
export default createContainer(() => {
Meteor.subscribe('userData');
Meteor.subscribe('problem');
Meteor.subscribe('sapporo');
Meteor.subscribe('language');
return {
_userData: userData.find({}).fetch(),
_problem: problem.find({}).fetch(),
_sapporo: sapporo.findOne({sapporo: true}),
_language: language.find({}).fetch()
};
}, Rank);
subscriptions: function () {
return [Meteor.subscribe('demoCardsets'), Meteor.subscribe('demoCards')];
},
data: function () {
subscriptions: function () {
return [Meteor.subscribe('repetitoriumCardsets'), Meteor.subscribe('paidCardsets'), Meteor.subscribe('userData')];
},
data: function () {
export default withTracker(() => {
Meteor.subscribe(OpqBoxes.getPublicationName());
return {
calibration_constants: Object.assign(...OpqBoxes.find().fetch().map(box => (
{ [box.box_id]: box.calibration_constant }
))),
};
})(EventSummary);
function composer({ queryParams }, onData) {
const insightHandle = Meteor.subscribe('insights.teamMembers', queryParams);
const brandHandle = Meteor.subscribe('brands.list', 0);
const brands = Brands.find({}, { sort: { name: 1 } }).fetch();
if (brandHandle.ready() && insightHandle.ready()) {
const mainData = MainGraph.find().fetch();
const usersData = UsersData.find().fetch();
onData(null, {
mainData,
usersData,
brands,
});
}
}