How to use hadron-app-registry - 7 common examples

To help you get started, we’ve selected a few hadron-app-registry 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 mongodb-js / compass-aggregations / electron / renderer / index.js View on Github external
// Activate our plugin with the Hadron App Registry
activate(appRegistry);
appRegistry.onActivated();

// Since we are using HtmlWebpackPlugin WITHOUT a template,
// we should create our own root node in the body element before rendering into it.
const root = document.createElement('div');
root.style = 'height: 100vh';
root.id = 'root';
document.body.appendChild(root);

// // Data service initialization and connection.
import Connection from 'mongodb-connection-model';
import DataService from 'mongodb-data-service';

const localAppRegistry = new AppRegistry();
const store = configureStore({
  localAppRegistry: localAppRegistry,
  globalAppRegistry: appRegistry,
  serverVersion: '4.2.0',
  fields: [
    { name: 'harry',
      value: 'harry',
      score: 1,
      meta: 'field',
      version: '0.0.0' },
    { name: 'potter',
      value: 'potter',
      score: 1,
      meta: 'field',
      version: '0.0.0' }
  ]
github mongodb-js / compass-aggregations / electron / renderer / index.js View on Github external
import app from 'hadron-app';
import AppRegistry from 'hadron-app-registry';
import { AppContainer } from 'react-hot-loader';
import AggregationsPlugin, { activate, CreateViewPlugin, DuplicateViewPlugin } from 'plugin';
import configureStore, { setDataProvider, setNamespace } from 'stores';
import configureCreateViewStore from 'stores/create-view';
import ExportToLanguagePlugin, {
  configureStore as configureExportToLangStore
} from '@mongodb-js/compass-export-to-language';

// Import global less file. Note: these styles WILL NOT be used in compass, as compass provides its own set
// of global styles. If you are wishing to style a given component, you should be writing a less file per
// component as per the CSS Modules ICSS spec. @see src/components/toggle-button for an example.
import 'less/global.less';

const appRegistry = new AppRegistry();

global.hadronApp = app;
global.hadronApp.appRegistry = appRegistry;

// Activate our plugin with the Hadron App Registry
activate(appRegistry);
appRegistry.onActivated();

// Since we are using HtmlWebpackPlugin WITHOUT a template,
// we should create our own root node in the body element before rendering into it.
const root = document.createElement('div');
root.style = 'height: 100vh';
root.id = 'root';
document.body.appendChild(root);

// // Data service initialization and connection.
github mongodb-js / compass-aggregations / src / stores / duplicate-view.spec.js View on Github external
describe('DuplicateViewStore [Store]', () => {
  const appRegistry = new AppRegistry();

  before(() => {
    store.onActivated(appRegistry);
  });

  describe('#onActivated', () => {
    context('when the data-service-connected event is emitted', () => {
      beforeEach(() => {
        appRegistry.emit('data-service-connected', null, 'testing');
      });

      it('dispatches the data service connected action', () => {
        expect(store.getState().dataService.dataService).to.equal('testing');
      });
    });
github mongodb-js / compass-aggregations / src / stores / store.spec.js View on Github external
describe('#onActivated', () => {
    let store;
    const localAppRegistry = new AppRegistry();
    const globalAppRegistry = new AppRegistry();

    beforeEach(() => {
      store = configureStore({
        localAppRegistry: localAppRegistry,
        globalAppRegistry: globalAppRegistry
      });
    });

    context('when the fields change', () => {
      it('updates the fields', (done) => {
        const unsubscribe = store.subscribe(() => {
          unsubscribe();
          expect(store.getState().fields).to.deep.equal([
            {
              name: 'harry',
github mongodb-js / compass-aggregations / src / stores / store.spec.js View on Github external
context('when providing an app registry', () => {
      let store;
      const localAppRegistry = new AppRegistry();
      const globalAppRegistry = new AppRegistry();

      beforeEach(() => {
        store = configureStore({
          localAppRegistry: localAppRegistry,
          globalAppRegistry: globalAppRegistry
        });
      });

      it('sets the app registry the state', () => {
        expect(store.getState().appRegistry).to.deep.equal({
          localAppRegistry: localAppRegistry,
          globalAppRegistry: globalAppRegistry
        });
      });
    });
github mongodb-js / compass-aggregations / src / stores / store.spec.js View on Github external
context('when providing an app registry', () => {
      let store;
      const localAppRegistry = new AppRegistry();
      const globalAppRegistry = new AppRegistry();

      beforeEach(() => {
        store = configureStore({
          localAppRegistry: localAppRegistry,
          globalAppRegistry: globalAppRegistry
        });
      });

      it('sets the app registry the state', () => {
        expect(store.getState().appRegistry).to.deep.equal({
          localAppRegistry: localAppRegistry,
          globalAppRegistry: globalAppRegistry
        });
      });
    });
github mongodb-js / compass-aggregations / src / stores / create-view.spec.js View on Github external
describe('CreateViewStore [Store]', () => {
  let store;
  const appRegistry = new AppRegistry();
  const ds = 'data-service';

  beforeEach(() => {
    store = configureStore({
      localAppRegistry: appRegistry,
      dataProvider: {
        error: null,
        dataProvider: ds
      }
    });
  });

  afterEach(() => {
    store = null;
  });

hadron-app-registry

Hadron App Registry

SSPL
Latest version published 1 month ago

Package Health Score

85 / 100
Full package analysis

Popular hadron-app-registry functions