[ DEMO ]
- Form state is in the redux store
- I removed all
toJScalls from selectors, so components deal w/ immutable objects Perf.starttriggered on form state update (w/ value1)Perf.stop— when this update is flushed to the DOM
Numbers from gif
| const selectEntity = entityId => ({ | |
| type: ENTITY_SELECT, | |
| entityId, | |
| }); | |
| const onEntitySelect = { | |
| [ENTITY_SELECT]: (state, { id }) => state.set('id', id), | |
| // ^ | |
| // oops, `entityId` was dispatched | |
| }; |
| // Chrome -> Bookmarks Bar -> Add Page… | |
| // Paste this in URL field: | |
| javascript:(function(){var p=document.location.search,r=/\&?w=1/;document.location.search=p?p.match(r)?p.replace(r,''):p+'&w=1':'?w=1'})() |
| /* eslint comma-dangle: ["error", "always-multiline"] */ | |
| // rest | |
| /* ok */ | |
| const rest = ({ | |
| prop, | |
| ...otherProps | |
| // ^ | |
| // no comma |
| :root { | |
| --button: { | |
| background-color: var(--bg-color); | |
| color: var(--text-color); | |
| } | |
| } | |
| .blueButton { | |
| --bg-color: blue; | |
| --text-color: #fff; |
[ DEMO ]
toJS calls from selectors, so components deal w/ immutable objectsPerf.start triggered on form state update (w/ value 1)Perf.stop — when this update is flushed to the DOMNumbers from gif
| // Bookmarks Bar -> Add Page… | |
| // URL: | |
| javascript:(function(){var p=document.location.search,r=/\&?w=1/;document.location.search=p?p.match(r)?p.replace(r,''):p+'&w=1':'?w=1'})() |