How to use the fluxible-addons-react/provideContext function in fluxible-addons-react

To help you get started, we’ve selected a few fluxible-addons-react 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 numenta / numenta-apps / unicorn / js / browser / components / Main.jsx View on Github external
// internals

import FileAddAction from '../actions/FileAdd';
import FileUploadAction from '../actions/FileUpload';
import FileList from '../components/FileList';
import FileDetails from '../components/FileDetails';
import LeftNav from '../components/LeftNav';
import ModelList from '../components/ModelList';
import UnicornTheme from '../lib/MaterialUI/UnicornTheme';


/**
 * React Main View Component
 */
@provideContext({
  getConfigClient: React.PropTypes.func,
  getLoggerClient: React.PropTypes.func,
  getDatabaseClient: React.PropTypes.func,
  getFileClient: React.PropTypes.func,
  getModelClient: React.PropTypes.func
})
@ThemeDecorator(ThemeManager.getMuiTheme(UnicornTheme)) // eslint-disable-line new-cap
export default class Main extends React.Component {

  static get contextTypes() {
    return {
      executeAction: React.PropTypes.func.isRequired
    };
  }

  constructor(props, context) {
github numenta / numenta-apps / unicorn / app / browser / components / Main.jsx View on Github external
import FileValidateAction from '../actions/FileValidate';
import FileList from './FileList';
import FileDetails from './FileDetails';
import HTMStudioTheme from '../lib/MaterialUI/HTMStudioTheme';
import LeftNav from './LeftNav';
import ModelList from './ModelList';

const app = remote.app;
const dialog = remote.require('dialog');


/**
 * React Main View Component
 */
@provideContext({
  getConfigClient: React.PropTypes.func,
  getLogger: React.PropTypes.func,
  getDatabaseClient: React.PropTypes.func,
  getFileClient: React.PropTypes.func,
  getGATracker: React.PropTypes.func,
  getModelClient: React.PropTypes.func,
  getParamFinderClient: React.PropTypes.func
})
@ThemeDecorator(ThemeManager.getMuiTheme(HTMStudioTheme)) // eslint-disable-line new-cap
export default class Main extends React.Component {

  static get contextTypes() {
    return {
      executeAction: React.PropTypes.func.isRequired,
      getParamFinderClient: React.PropTypes.func,
      getConfigClient: React.PropTypes.func,
github slidewiki / slidewiki-platform / test / unit / ContentModulesStore.js View on Github external
beforeEach('render and locate element', function(done){

    let testStores = [ContentModuleStore];
    let context = createMockComponentContext({
      stores : testStores
    });

    let testComponent = provideContext(connectToStores(component, testStores, function(){
      return {};
    }));

    component = TestUtils.renderIntoDocument();

    done();

  });
github quran / quran.com-frontend / tests / unit / components / header / SearchInput.spec.js View on Github external
beforeEach(function() {
    context = createMockComponentContext({});
    sinon.stub(context, 'executeAction');

    var SearchInputClass = provideContext(SearchInput);

    component = ReactTestUtils.renderIntoDocument(
      
    );

    node = ReactDOM.findDOMNode(component);
  });
github quran / quran.com-frontend / tests / unit / components / Pagination.spec.js View on Github external
makeComponent = function(page) {
      var currentRoute = Immutable.Map({
        path: 'http:localhost:8000',
        query: Immutable.Map({q: 'light', p: page || 1})
      });

      var context = createMockComponentContext({
        stores: [RouteStore]
      });

      context.dispatcherContext.dispatcher.stores.RouteStore.prototype.getCurrentRoute = function() {
        return currentRoute;
      }

      var PaginationClass = provideContext(Pagination);

      component = ReactTestUtils.renderIntoDocument(
        
      );

      node = ReactDOM.findDOMNode(component);
    }
  });
github quran / quran.com-frontend / tests / unit / components / audioplayer / Audioplayer.spec.js View on Github external
beforeEach(function() {
    clock = sinon.useFakeTimers();

    context = createMockComponentContext({
      stores: [AudioplayerStore, SurahsStore, AyahsStore]
    });

    context.getStore('SurahsStore').surahs = getSurahs;
    context.getStore('AyahsStore').ayahs = getAyahs;
    context.getStore('AudioplayerStore').currentAyah = getAyahs[0];
    context.getStore('AudioplayerStore').currentAudio = new AudioStub(getAyahs[0].audio.mp3.url);

    var AudioplayerClass = provideContext(Audioplayer);

    component = ReactTestUtils.renderIntoDocument(
      
    );

    node = ReactDOM.findDOMNode(component);

    foundComponent = ReactTestUtils.findAllInRenderedTree(component, function(t) {
      return t.constructor.name === 'Audioplayer';
    })[0];

    sinon.stub(context, 'executeAction');
    sinon.stub(foundComponent, 'changeAyah');
    sinon.stub(foundComponent, 'loadRestOfAudio');
  });

fluxible-addons-react

Fluxible addons for use with React

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis

Similar packages