Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 Home from '../components/home';
export const composer = ({context}, onData) => {
// const {Meteor, Collections} = context();
onData(null, {});
};
export const depsMapper = (context) => ({
context: () => context
});
export default composeAll(
composeWithTracker(composer, ()=>errorLoading, ()=>errorLoading),
useDeps(depsMapper)
)(Home);
export const composer = ({context}, onData) => {
const { Meteor } = context();
console.log(Meteor.user());
onData(null, { user: Meteor.user() });
};
export const depsMapper = (context, actions) => ({
context: () => context,
Actions: context.Actions,
logout: actions.account.logout
});
export default composeAll(
composeWithTracker(composer, L, E),
useDeps(depsMapper)
)(Home);
const {LocalState} = context();
const error = LocalState.get('CREATE_COMMENT_ERROR');
onData(null, {error});
return clearErrors;
};
export const depsMapper = (context, actions) => ({
create: actions.comments.create,
clearErrors: actions.comments.clearErrors,
context: () => context
});
export default composeAll(
composeWithTracker(composer),
useDeps(depsMapper)
)(Component);
import Login from '../components/login';
export const composer = ({context}, onData) => {
const { Meteor, LocalState } = context();
onData(null, {error: LocalState.get('LOGIN_ERROR'), success: LocalState.get('LOGIN_SUCCESS')});
};
export const depsMapper = (context, actions) => ({
context: () => context,
login: actions.account.login
});
export default composeAll(
composeWithTracker(composer, L, E),
useDeps(depsMapper)
)(Login);
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);
export default (component) => composeAll(
composeWithTracker(_authComposer),
useDeps(_authDepsMapper)
)(component);
export default (component) => composeAll(
composeWithTracker(_navHeaderComposer),
useDeps(_depsMapper)
)(component);
import DownPanel from '../components/down_panel';
import { useDeps, composeAll } from 'mantra-core';
import reduxComposer from '../libs/redux_composer';
export function composer({}, { context }) {
return {
addons: context().provider.getAddons(),
};
}
export default composeAll(
reduxComposer(composer),
useDeps()
)(DownPanel);
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);