Skip to content

Instantly share code, notes, and snippets.

Avatar

Ezekiel Chentnik ezekielchentnik

View GitHub Profile
@kitze
kitze / store.js
Created Jan 24, 2018
simplified redux
View store.js
import produce from 'immer';
import {createStore} from 'redux';
const handleActions = (actionsMap, defaultState) => (
state = defaultState,
{type, payload}
) =>
produce(state, draft => {
const action = actionsMap[type];
action && action(draft, payload);
@developit
developit / preact-8-changes.md
Last active Aug 25, 2017
Important changes coming in Preact 8
View preact-8-changes.md

Removed: Element Recycling

DOM Element recycling will be removed in Preact 8.

This should have no effect on most applications. In fact, it fixes a number of known issues related to element state not being fully reset on reuse.

💡 Why? Many DOM properties are stateful, and trying to reset them all when recycling is a game of whack-a-mole. Preact's size makes it infeasible to use whitelists to address these issues, so recycling is being dropped. >