Permalink
Browse files

Add Flow types for reducers

  • Loading branch information...
frantic committed May 31, 2016
1 parent 1be2cfb commit 350ded0f6f3146e8cb1b486f9774a1bc97bc275d
Showing with 8 additions and 1 deletion.
  1. +8 −1 reducers.js
@@ -1,9 +1,16 @@
// @flow

type State = {
isLoggedIn: boolean;
userName: string;
};

const initialState = {
isLoggedIn: false,
userName: 'unknown'
};

export function user(state = initialState, action) {
export function user(state: State = initialState, action: Object): State {
if (action.type === 'LOGGED_IN') {
return {
isLoggedIn: true,

0 comments on commit 350ded0

Please sign in to comment.