Skip to content

Instantly share code, notes, and snippets.

@acdlite
acdlite / coordinating-async-react.md
Last active June 17, 2024 11:56
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

@namelos
namelos / minCounter.js
Last active February 19, 2016 10:58
Minimalist redux example
import React, { Component } from 'react'
import { render } from 'react-dom'
import { createStore, bindActionCreators } from 'redux'
import { connect, Provider } from 'react-redux'
const increment = () => ({ type: 'increment' })
const counter = (state = 0, action) => {
switch (action.type) {
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note