Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should work with addListener() (Facebook Flux)', (done) => {
class CustomStore extends FluxUtils.ReduceStore {
getInitialState() {
return 13;
}
reduce(state, action) {
switch (action.type) {
default:
return state;
}
}
}
const dispatcher = new Flux.Dispatcher();
const store = new CustomStore(dispatcher);
const stream = fromStore(store);
/**
* @author Junichi Kato
*/
import * as Flux from 'flux';
import * as FluxUtils from 'flux/utils';
import { HelloWorldState } from './HelloWorldState';
import { HelloWorldAction } from './HelloWorldAction';
import { helloWorldDispatcher } from './HelloWorldDispatcher';
/**
* The ReduceStore for {@class HelloWorldState} and {@class HelloWorldAction}.
*/
export class HelloWorldStore extends FluxUtils.ReduceStore {
constructor(dispatcher: Flux.Dispatcher) {
super(dispatcher);
}
/**
* @override method.
*
* @see {FluxUtils.ReduceStore#getInitialState}
*
* @returns {TodoState}
*/
getInitialState(): HelloWorldState {
return new HelloWorldState("", "");
}
/**
*/
///
import * as Flux from 'flux';
import * as FluxUtils from 'flux/utils';
import { TodoState } from './TodoState';
import { TodoAction } from '../application/TodoAction';
import { TodoRepository } from '../domain/TodoRepository';
import { TodoAggregate } from '../domain/TodoAggregate';
import { Guid } from '../infrastructure/Guid';
import { todoDispatcher } from './TodoDispatcher';
import { CreateTodo } from '../ui/TodoActions';
/**
* The ReducerStore for the {@class TodoState} and {@class TodoAction}.
*/
export class TodoStore extends FluxUtils.ReduceStore {
constructor(dispatcher: Flux.Dispatcher) {
super(dispatcher);
}
/**
* @override method.
*
* @see {FluxUtils.ReduceStore#getInitialState}
*
* @returns {TodoState}
*/
getInitialState(): TodoState {
return new TodoState('', new TodoRepository());
}
/**