Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const {LocalState} = context();
const error = LocalState.get('SAVING_ERROR');
onData(null, {error});
// clearErrors when unmounting the component
return clearErrors;
};
export const depsMapper = (context, actions) => ({
create: actions.posts.create,
clearErrors: actions.posts.clearErrors,
context: () => context
});
export default composeAll(
composeWithTracker(composer),
useDeps(depsMapper)
)(NewPost);
import PostList from '../components/postlist';
import {useDeps, composeWithTracker, composeAll} from 'mantra-core';
export const composer = ({context}, onData) => {
const {Meteor, Collections} = context();
if (Meteor.subscribe('posts.list').ready()) {
const posts = Collections.Posts.find().fetch();
onData(null, {posts});
}
};
export default composeAll(
composeWithTracker(composer),
useDeps()
)(PostList);
import UserSearch from '../components/UserSearch.jsx';
import {useDeps, composeWithTracker, composeAll} from 'mantra-core';
export const composer = ({context}, onData) => {
const {Meteor, Collections} = context();
onData(null, {});
};
export default composeAll(
composeWithTracker(composer),
useDeps()
)(UserSearch);
import PostList from '../components/postlist.jsx';
import {useDeps, composeWithTracker, composeAll} from 'mantra-core';
export const composer = ({context}, onData) => {
const {Meteor, Collections} = context();
if (Meteor.subscribe('posts.list').ready()) {
const posts = Collections.Posts.find().fetch();
onData(null, {posts});
}
};
export default composeAll(
composeWithTracker(composer),
useDeps()
)(PostList);
export const composer = ({context, clearErrors, postId}, onData) => {
const {Meteor, Collections} = context();
if (Meteor.subscribe('posts.comments', postId).ready()) {
const options = {
sort: {createdAt: -1}
};
const comments = Collections.Comments.find({postId}, options).fetch();
onData(null, {comments});
} else {
onData();
}
};
export default composeAll(
composeWithTracker(composer),
useDeps()
)(Component);
export default (component) => composeAll(
composeWithTracker(_authComposer),
useDeps(_authDepsMapper)
)(component);
export default (component) => composeAll(
composeWithTracker(_navHeaderComposer),
useDeps(_depsMapper)
)(component);
import {authComposer} from 'meteor-auth';
import EnsureLoggedin from '../components/ensure_logged_in.jsx';
export const composer = ({context}, onData) => {
const {Meteor, Collections} = context();
onData(null, {});
};
export const depsMapper = (context, actions) => ({
context: () => context
});
export default composeAll(
composeWithTracker(authComposer),
composeWithTracker(composer),
useDeps(depsMapper)
)(EnsureLoggedin);
addTodo(todo);
};
const onClickCheckBtn = (todoId) => {
checkTodo(todoId);
};
return {
onClickAddButton,
onClickCheckBtn,
context: () => context,
};
};
export default composeAll(
composeWithTracker(collectionComposer),
compose(stateComposer),
useDeps(depsMapper)
)(TodoList);