Skip to content

Instantly share code, notes, and snippets.

// reducer.js
let initialState = 0;
function reducer (state=initialState, action) {
switch(action.type){
case 'INCREMENT_COUNT':
return state + 1;
default:
return state
}
import React, { Component } from 'react';
let HOCGen = (Component)=>class extends React.Component{
constructor(props){
super(props);
this.state = {
count: 0
}
}