How to use the fusion-core.default function in fusion-core

To help you get started, we’ve selected a few fusion-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 fusionjs / fusionjs / fusion-plugin-error-handling / fixtures / unhandled-rejection.js View on Github external
* LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

/* eslint-env node */
const App = require('fusion-core').default;
// eslint-disable-next-line import/no-unresolved
// $FlowFixMe
const {default: Plugin, ErrorHandlerToken} = require('../dist/index.js');

const onError = e => {
  console.log('ERROR HANDLER', e); // eslint-disable-line
};

const app = new App('el', el => el);

app.register(Plugin);
app.register(ErrorHandlerToken, onError);
app.resolve();

// keep the process running
setInterval(() => {}, 1000);

Promise.reject(new Error('FAIL'));
github fusionjs / fusionjs / fusion-plugin-error-handling / fixtures / uncaught-exception.js View on Github external
* LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

/* eslint-env node */
const App = require('fusion-core').default;
// eslint-disable-next-line import/no-unresolved
// $FlowFixMe
const {default: Plugin, ErrorHandlerToken} = require('../dist/index.js');

const onError = e => {
  console.log('ERROR HANDLER', e); // eslint-disable-line
};

const app = new App('el', el => el);

app.register(Plugin);
app.register(ErrorHandlerToken, onError);
app.resolve();

// keep the process running
setInterval(() => {}, 1000);

throw new Error('FAIL');