Permalink
Browse files

Add Flow types for dispatch

  • Loading branch information...
frantic committed May 31, 2016
1 parent c351616 commit 4c72149b4bc6008737c4e0975ff61ab4ff801eca
Showing with 15 additions and 1 deletion.
  1. +10 −1 components.js
  2. +5 −0 store.js
@@ -1,8 +1,17 @@
// @flow

import React from 'react';
import {logIn, logOut} from './actions';
import {connect} from 'react-redux';

export function SettingsScreen(props) {
import type {Dispatch} from './store';

type Props = {
userName: string;
dispatch: Dispatch;
};

export function SettingsScreen(props: Props) {
return (
<div>
<div>
@@ -1,6 +1,11 @@
// @flow

import * as Redux from 'redux';
import * as reducers from './reducers';

import type {Action} from './actions';
export type Dispatch = (action: Action | Promise<Action>) => Promise;

const promiseMiddleware = store => next => action =>
typeof action.then === 'function'
? Promise.resolve(action).then(next)

0 comments on commit 4c72149

Please sign in to comment.