How to use mantra-core - 10 common examples

To help you get started, we’ve selected a few mantra-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mantrajs / meteor-mantra-kickstarter / client / modules / core / containers / newpost.js View on Github external
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);
github mantrajs / meteor-mantra-kickstarter / client / modules / core / containers / newpost.js View on Github external
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);
github inProgress-team / react-native-mantra-boilerplate / src / modules / core / containers / home.js View on Github external
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);
github inProgress-team / react-native-mantra-boilerplate / src / client / modules / core / containers / home.js View on Github external
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);
github mantrajs / meteor-mantra-kickstarter / client / modules / core / containers / postlist.js View on Github external
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);
github janikvonrotz / EverestCamp / client / modules / users / containers / UserSearch.js View on Github external
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);
github mantrajs / kickstart-mantrajs-webpack / src / client / modules / core / containers / postlist.js View on Github external
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);
github mantrajs / meteor-mantra-kickstarter / client / modules / comments / containers / comment_list.js View on Github external
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);
github mantrajs / meteor-mantra-kickstarter / client / modules / core / containers / postlist.js View on Github external
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);
github mantrajs / meteor-mantra-kickstarter / client / modules / app / lib / Auth.js View on Github external
export default (component) => composeAll(
    composeWithTracker(_authComposer),
    useDeps(_authDepsMapper)
  )(component);

mantra-core

Core API for Mantra

MIT
Latest version published 9 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages