Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Tracker.autorun(() => {
const simsHandle = Meteor.subscribe('sims');
const loading = !simsHandle.ready();
const flatData = Sims.find({ userId: Meteor.userId() }).fetch();
const simsExists = !loading && !!flatData;
const getKey = node => node._id;
const getParentKey = node => node.parent_id;
const rootKey = '0';
const treeData = getTreeFromFlatData({
flatData,
getKey,
getParentKey,
rootKey,
});
this.setState({
simsExists,
treeData: simsExists ? treeData : [],
});
});
}
this.lessonsTracker = Tracker.autorun(() => {
const lessonsHandle = Meteor.subscribe('lessons');
const loading = !lessonsHandle.ready();
const flatData = Lessons.find({ userId: Meteor.userId() }).fetch();
const getKey = node => node._id;
const getParentKey = node => node.parent_id;
const rootKey = '0';
const treeData = getTreeFromFlatData({
flatData,
getKey,
getParentKey,
rootKey,
});
this.setState({
treeData,
loading,
});
});
}
this.lessonsTracker = Tracker.autorun(() => {
const lessonsHandle = Meteor.subscribe('lessons')
const loading = !lessonsHandle.ready()
const flatData = Lessons.find({ userId: Meteor.userId() }).fetch()
const getKey = node => node._id
const getParentKey = node => node.parent_id
const rootKey = '0'
const treeData = getTreeFromFlatData({
flatData,
getKey,
getParentKey,
rootKey
})
this.setState({
treeData,
loading
})
})
}
render() {
const treeData = getTreeFromFlatData({
flatData: Object.values(this.props.blockchain.blocks),
getKey: block => block.hash,
getParentKey: block => block.parentHash,
rootKey: this.props.blockchain.genesis.parentHash
});
const longestChain = this.props.blockchain.longestChain();
return (
<div style="{{">
this.setState({ treeData })}
generateNodeProps={generateNodeProps(longestChain).bind(this)}
/>
</div>
export default LessonPlansDirectoriesContainer = withTracker(()=>{
const lessonplansHandle = Meteor.subscribe('lessonplans')
const loading = !lessonplansHandle.ready()
const flatData = LessonPlans.find({userId: Meteor.userId()}).fetch()
const lessonplansExists = !loading && !!flatData
const getKey = node => node._id
const getParentKey = node => node.parent_id
const rootKey = '0'
const treeData = getTreeFromFlatData({
flatData,
getKey,
getParentKey,
rootKey
})
return {
lessonplansExists,
treeData
}
})(LessonPlansDirectories)
export default withTracker(() => {
const workbooksHandle = Meteor.subscribe('workbooks');
const loading = !workbooksHandle.ready();
const flatData = Workbooks.find({ userId: Meteor.userId() }).fetch();
const workbooksExists = !loading && !!flatData;
const getKey = node => node._id;
const getParentKey = node => node.parent_id;
const rootKey = '0';
const treeData = getTreeFromFlatData({
flatData,
getKey,
getParentKey,
rootKey,
});
return {
workbooksExists,
treeData,
};
})(WorkbooksDirectories);