How to use the react-komposer.compose function in react-komposer

To help you get started, we’ve selected a few react-komposer 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 inProgress-team / react-native-meteor / src / components / composeWithTracker.js View on Github external
return Trackr.autorun(() => {
        _meteorDataDep.depend();
        trackerCleanup = reactiveFn(props, onData);
      });
    });

    return () => {
      if (typeof trackerCleanup === 'function') {
        trackerCleanup();
      }
      Data.offChange(_meteorDataChangedCallback);
      return handler.stop();
    };
  };

  return compose(onPropsChange, L, E, options);
}
github erxes / erxes / imports / react-ui / layout / containers / MainLayout.js View on Github external
import { Meteor } from 'meteor/meteor';
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import MainLayout from '../components/MainLayout';

function composer(props, onData) {
  onData(null, {
    loggedIn: !!Meteor.user(),
    loggingIn: Meteor.loggingIn(),
  });
}

export default compose(getTrackerLoader(composer), composerOptions({}))(MainLayout);
github erxes / erxes / imports / react-ui / settings / forms / containers / Form.js View on Github external
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import { Form } from '../components';

function composer({ form }, onData) {
  onData(null, {
    form,
  });
}

export default compose(getTrackerLoader(composer), composerOptions({ spinner: true }))(Form);
github erxes / erxes / imports / react-ui / layout / containers / QuickNavigation.js View on Github external
import { Meteor } from 'meteor/meteor';
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import QuickNavigation from '../components/QuickNavigation';

function composer(props, onData) {
  const handler = Meteor.subscribe('notifications.unreadCount');

  if (handler.ready()) {
    const unreadCount = 0;
    onData(null, { unreadCount });
  }
}

export default compose(getTrackerLoader(composer), composerOptions({}))(QuickNavigation);
github erxes / erxes / imports / react-ui / settings / brands / containers / BrandForm.js View on Github external
import { compose } from 'react-komposer';
import { getTrackerLoader, composerOptions } from '/imports/react-ui/utils';
import { BrandForm } from '../components';

function composer({ brand }, onData) {
  onData(null, {
    brand,
  });
}

export default compose(getTrackerLoader(composer), composerOptions({ spinner: true }))(BrandForm);
github Astrocoders / nubank-clone / src / Containers / user_stored_token.js View on Github external
}
    
    onData(null, {
      loadingStoredUser: false,
      hasStoredUser: storedUser,
    });

    if(storedUser){
      Actions.dashboard({type: 'replace'});
    } else {
      Actions.intro({type: 'replace'});
    }
  });
}

export default compose(composer, Loader, Loader);

react-komposer

Generic way to compose data containers for React.

MIT
Latest version published 8 years ago

Package Health Score

53 / 100
Full package analysis