How to use just-compose - 1 common examples

To help you get started, we’ve selected a few just-compose 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 fusionjs / fusionjs / fusion-react / src / __tests__ / hoc.node.js View on Github external
tape('hoc', async t => {
  const TestToken1 = createToken('test-token-1');
  const TestToken2 = createToken('test-token-2');
  const TestToken3 = createToken('test-token-3');
  const withTest = compose(
    hoc.create('test1', undefined, TestToken1),
    hoc.create('test2', undefined, TestToken2),
    hoc.create('test3', provides => ({mapped: provides}), TestToken3)
  );
  const testProvides1 = {hello: 1};
  const testProvides2 = {hello: 2};
  const testProvides3 = {hello: 3};
  let didRender = false;
  function TestComponent(props) {
    didRender = true;
    t.deepLooseEqual(props.test1, testProvides1, 'works with plain plugin');
    t.deepLooseEqual(
      props.test2,
      testProvides2,
      'works with legacy PluginProvider'
    );

just-compose

return a function composed of 2 or more functions

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis

Popular just-compose functions