Skip to content

Instantly share code, notes, and snippets.

View chentsulin's full-sized avatar
🕶️
Keep learning

C. T. Lin chentsulin

🕶️
Keep learning
View GitHub Profile
@chentsulin
chentsulin / slim-redux.js
Last active September 23, 2015 00:25 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-) . Simplify for beginner
import { mapValues, pick, compose } from 'lodash';
function bindActionCreator(actionCreator, dispatch) {
return (...args) => dispatch(actionCreator(...args));
}
export function bindActionCreators(actionCreators, dispatch) {
return typeof actionCreators === 'function' ?
bindActionCreator(actionCreators, dispatch) :
mapValues(actionCreators, actionCreator =>
@chentsulin
chentsulin / redux-devtools-separate-window.js
Last active September 13, 2015 13:04 — forked from tlrobinson/redux-devtools-separate-window.js
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
import React from 'react';
import ReactDom from 'react-dom';
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';
export default function createDevToolsWindow(store) {
// give it a name so it reuses the same window
const win = window.open(null, 'redux-devtools', 'menubar=no,location=no,resizable=yes,scrollbars=no,status=no');
// reload in case it's reusing the same window with the old content