aretherecookies-mobile/js/streams/CreateFoodItemStream.js
2018-02-04 13:14:37 -06:00

19 lines
460 B
JavaScript

// @flow
import { ReplaySubject } from 'rxjs';
import FoodItemRecord from '../records/FoodItemRecord';
type CreateFoodItemState = {
foodItem: FoodItemRecord,
loading: boolean,
error?: ?Error,
};
const multicaster: ReplaySubject<CreateFoodItemState> = new ReplaySubject();
export function emitter(val: CreateFoodItemState) {
multicaster.next(val);
}
emitter({ foodItem: new FoodItemRecord(), loading: false, error: null });
export default multicaster;