Skip to content

Instantly share code, notes, and snippets.

@don-smith
Created July 12, 2016 22:51
Show Gist options
  • Save don-smith/47fc2afa02aaef67936831a5ff83aab1 to your computer and use it in GitHub Desktop.
Save don-smith/47fc2afa02aaef67936831a5ff83aab1 to your computer and use it in GitHub Desktop.

Code review feedback

  • Rename firebaseInit.js to api/index.js or something similar that is not tied to a technology.

    • This will let you export each function from its own file (imported into index.js)
    • Import library code (firebase, ramda) before your code (dbInit)
    • Remove commented out code
  • If we're not using Firebase UI, we should remove the config in dbInit.

  • Should incorporate consistent naming for actions and reducers.

  • Unneeded semicolons (not consistent) in authAction.js, but should check all files.

  • It's good to take pride in your code. Should apply consistent formatting/indentation to all files, and remove all instances of console.log().

  • In combineReducers.js, if (during import) you change the name of routerReducer and formReducer to routing and form respectively, you can get rid of a lot of code:

export default combineReducers({ activities, auth, form, routing })

thanks to ES6's streamlined object literal syntax. Obviously optional ;)

  • AUTH_LOGIN is defined in both actions/authAction.js and constants/authConstants.js

    • Since you only have 4 states that are constants, can these not be moved into actions/authAction.js?
  • deleteActivityReducer.js shouldn't be its own reducer. Just have a single reducer that is responsible for the activities array.

  • createActivityActions.js should include an action/reducer that adds the new activity to the local state while we wait for the response to come back from Firebase.

  • reducers/eventlist.js is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment