Skip to content

Instantly share code, notes, and snippets.

@keshavkaul
keshavkaul / connect.jsx
Last active August 4, 2018 09:13
A react redux connect API inspired by `react-redux` library using latest React features.
import * as React from 'react';
const StoreContext = React.createContext();
const StoreProvider = StoreContext.Provider;
const StoreConsumer = StoreContext.Consumer;
const isShallowEqual = (objA, objB) => {
const hasOwn = Object.prototype.hasOwnProperty
function is(x, y) {