Skip to content

Instantly share code, notes, and snippets.

View pmrt's full-sized avatar

Pedro M. M. pmrt

  • Granada, Spain
View GitHub Profile
@astoilkov
astoilkov / readme.md
Last active March 13, 2024 10:19
Async Operations with useReducer Hook

Async Operations with useReducer Hook

9 March, 2019

We were discussing with @erusev what we can do with async operation when using useReducer() in our application. Our app is simple and we don't want to use a state management library. All our requirements are satisfied with using one root useReducer(). The problem we are facing and don't know how to solve is async operations.

In a discussion with Dan Abramov he recommends Solution 3 but points out that things are fresh with hooks and there could be better ways of handling the problem.

Problem

@darcyparker
darcyparker / installNeovim.sh
Last active January 13, 2024 04:28
Build and install neovim for Debian
#!/usr/bin/env bash
#Build and install neovim for Debian
#See: https://neovim.io/
#See: https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start
#See: https://gist.github.com/darcyparker/153124662b05c679c417
#Save current dir
pushd . > /dev/null || exit