Skip to content

Instantly share code, notes, and snippets.

View sathify's full-sized avatar

Satheesh Kumar sathify

  • Descript
  • San Francisco
View GitHub Profile
@sathify
sathify / account-index.jsx
Created November 5, 2015 05:24 — forked from jedireza/account-index.jsx
on the client side
/* global window */
var React = require('react/addons');
var ReactRouter = require('react-router');
var Routes = require('./Routes.react');
var MeStore = require('../../stores/Me');
var MeActions = require('../../actions/Me');
var RedirectActions = require('../../actions/Redirect');
var HistoryLocation = ReactRouter.HistoryLocation;
@sathify
sathify / Enhance.js
Created October 25, 2015 03:16 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@sathify
sathify / slim-redux.js
Created October 22, 2015 17:41 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {