Skip to content

Instantly share code, notes, and snippets.

View azizhk's full-sized avatar
:octocat:
Keep git history linear, squash and merge into master.

Aziz Khambati azizhk

:octocat:
Keep git history linear, squash and merge into master.
View GitHub Profile
@azizhk
azizhk / _readme.md
Created January 18, 2018 07:41
Dispatch your reducer codemod

Codemod to convert your redux code from dispatching a type string to reducer function.

The reducer_codemod.js converts

export default createStore(initialState, {
  GOT_PAGE_DATA: (state, payload) => {
    return {
      ...state,
      data: payload
 };
@azizhk
azizhk / Promises.md
Last active January 17, 2018 15:17
Promises Best Practises and Anti Patterns

Promises Best Practices and Anti Patterns

The following might look like an opinionated article, please give your opinions as well. I am actually just publishing this to validate my thoughts. Do recommend if you agree with it.

Improving a Piece of Bad Code

So lets start with bad code. This is an example of someone who hasn't escaped callback Hell.

function getHotDog () {