Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props: GigaProps) {
super(props);
this.dispatcher = new Dispatcher();
this.store = GigaGrid.createStore(props, this.dispatcher);
this.state = this.store.getState();
// do not call setState again, this is the only place! otherwise you are violating the principles of Flux
// not that would be wrong but it would break the 1 way data flow and make keeping track of mutation difficult
this.store.addListener(() => {
this.setState(this.store.getState());
});
}
_createDispatcher() {
// No need to dispose dispatcher, GC will eat it.
this._dispatcher = new Dispatcher;
Map(this.actionsAndStores).forEach((array, feature) => {
const {store} = Flux.findActionsAndStores(array);
if (!store) return;
this._dispatcher.register(this._onDispatch.bind(this, feature, store));
});
}
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
var Dispatcher = require('flux').Dispatcher;
var TabsStore = require('./TabsStore');
var Executor = require('./Executor');
var Config = require('./Config');
var History = require('./History');
var Cloud = require('./Cloud');
var AppDispatcher = new Dispatcher();
var SignalsDispatcher = new Dispatcher();
var DBDispatcher = new Dispatcher();
SignalsDispatcher.register(function(payload){
// separate dispatcher needed to avoid parallel actions execution
switch(payload.eventName){
case 'execute-script':
TabsStore.setRenderer('plain');
TabsStore.trigger('execute-script-'+TabsStore.selectedTab);
break;
case 'execute-block':
TabsStore.setRenderer('auto');
TabsStore.trigger('execute-block-'+TabsStore.selectedTab);
break;
case 'execute-all':
TabsStore.setRenderer('auto');
TabsStore.trigger('execute-all-'+TabsStore.selectedTab);
break;
import { assert, debug, maybeHas, has, translate as $t, NONE_CATEGORY_ID,
setupTranslator, localeComparator } from './helpers';
import { Account, Alert, Bank, Category, Operation, OperationType } from './models';
import { Dispatcher } from 'flux';
import * as backend from './backend';
import { genericErrorHandler } from './errors';
import DefaultSettings from '../shared/default-settings';
const events = new EE;
const flux = new Dispatcher;
// Private data
const data = {
categories: [],
// maps category ids to categories
categoryMap: new Map(),
currentBankId: null,
currentAccountId: null,
settings: new Map(DefaultSettings),
// Map of Banks (id -> bank)
// (Each bank has an "account" field which is a map (id -> account),
// each account has an "operation" field which is an array of Operation).
banks: new Map,
import { Dispatcher } from 'flux';
export class TypedEvent<p> {
constructor(public payload: P) {}
}
export type Event = TypedEvent;
const dispatcherInstance: Flux.Dispatcher = new Dispatcher();
export const AppDispatcher = dispatcherInstance;
</p>
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _flux = require('flux');
/** Creates a singlar instance of Facebook's Dispatcher */
var appDispatcher = new _flux.Dispatcher();
exports.default = appDispatcher;
function MicroFlux() {
this.dispatcher = new Dispatcher()
}
/*
* AppDispatcher
*
* A singleton that operates as the central hub for application updates.
*/
var Dispatcher = require('flux').Dispatcher;
module.exports = new Dispatcher();
import { Dispatcher } from 'flux'
import assign from 'object-assign'
import invariant from 'invariant'
var AppDispatcher = assign(new Dispatcher(), {
dispatch(action) {
invariant(action.actionType, 'action type is undefined.')
Dispatcher.prototype.dispatch.call(this, action)
}
})
module.exports = AppDispatcher
'use strict';
var Dispatcher = require('flux').Dispatcher;
module.exports = new Dispatcher();