Skip to content

Instantly share code, notes, and snippets.

View mariabitsch's full-sized avatar

Maria Bitsch mariabitsch

  • Copenhagen, Denmark
View GitHub Profile
@mariabitsch
mariabitsch / index.js
Created April 2, 2016 12:45 — forked from gaearon/index.js
Breaking out of Redux paradigm to isolate apps
import React, { Component } from 'react'
import Subapp from './subapp/Root'
class BigApp extends Component {
render() {
return (
<div>
<Subapp />
<Subapp />
<Subapp />
var callByName = (function(global) {
return function(name, args, thisArg) {
return global[name].call(thisArg, args);
}
})(this);
@mariabitsch
mariabitsch / ducktype.js
Last active August 29, 2015 13:59
Node modules for basic type checking
exports.isKindOf = function(duck, obj) {
var fn = function(obj) {
return Object.getOwnPropertyNames(duck).every(function(name) {
return obj.hasOwnProperty(name);
});
};
return obj === undefined ? fn : fn(obj);
};