Skip to content

Instantly share code, notes, and snippets.


Lenz Weber phryneas

View GitHub Profile

Do not create union types with Redux Action Types. It's most likely an antipattern.

So, there is a long-standing TypeScript & Redux pattern of creating a union RootAction type that contains all your application's action types. Sometimes, you would also create a lot of reducer-specific sub-unions. I think that this has always been a crutch - and given the options we have today, it's most likely an antipattern. So let's look at why it was used, where it was used and what you can use instead.

Why was it used? A look at typed Reducers.

Classically, these action union types were created to use the Discriminating Union pattern.

phryneas /
Last active Apr 24, 2020
api-documenter test


API Reference


Package Description
#!/usr/bin/env bash
#remove all git tags
git tag | xargs git tag -d
#re-apply all git tags with commit name => tag name
git log --pretty=%s---%H | sed -re 's/[^a-zA-Z0-9-]/_/g;s/---/ /' | xargs -n2 git tag
git tag --format="%(objectname) => %(refname)"
phryneas / index.d.ts
Created Sep 12, 2019
buggy types rollup
View index.d.ts
/// <reference types="react" />
import { ComponentClass } from 'react';
import * as CSS from 'csstype';
import * as PropTypes from 'prop-types';
import React from 'react';
declare interface AbstractAction {
type: string;
meta: {
counter: number;
phryneas / doczrc.js
Created Mar 4, 2019
View doczrc.js
import { resolve } from 'path';
export default {
modifyBundlerConfig: config => {
const orig = config.module.rules[2];
const origUse = orig.use;
orig.use = [
phryneas / default.nix
Created Dec 12, 2018 — forked from ottidmes/default.nix
VS Code Live Share extension
View default.nix
# Baseed on previous attempts of others:
{ lib, vscode-utils, autoPatchelfHook, bash, file, makeWrapper, dotnet-sdk
, curl, gcc, icu, libkrb5, libsecret, libunwind, libX11, lttng-ust, openssl, utillinux, zlib
, enableDiagnosticsWorkaround ? false, gccStdenv
with lib;
phryneas / home-manager-module.nix
Last active Jun 14, 2020
View home-manager-module.nix
{pkgs, lib, config, ...}:
with lib;
liveshareGist = builtins.fetchTarball {
url = "";
sha256 = "0mas9rnr6hn7yiivjs5xvnprhrqwac47nqfxh3vgmm67v982v83l";
livesharePkg = pkgs.callPackage liveshareGist {};
cfg =;
pkg = livesharePkg.override { enableDiagnosticsWorkaround = cfg.enableDiagnosticsWorkaround; };
View default.nix
{ stdenv, runCommand, electron, callPackage,
bash, python, jq, nodejs-8_x, node? nodejs-8_x, neovim, ripgrep, xorg,
yarn2nix = callPackage ( builtins.fetchTarball {
url = " " ;
sha256 = "0ih11vcd9ad5y13877bxz7ijsykhqwdfwmvwhic3xlgcdhxji80v";
}) {};
version = "v0.3.6";
oniSrc = builtins.fetchTarball {
View configuration.nix
{ config, pkgs, ... }:
imports =
# use zfs from current master instead of nixos bundled versoin
View vscodeliveshare.nix
{ stdenv, vscode-utils, autoPatchelfHook,
/*icu, curl, lttng-ust,*/ libX11, gnome3,
utillinux, openssl, icu, zlib, curl, lttng-ust, libsecret, libkrb5,
gcc, libunwind, binutils
runtimeVersion = "2.1.1";
runtimeHash = "6985b9f6844d51ba1197c3f52aabc7291bb15bc1";
runtime = fetchTarball {
url = "${runtimeVersion}-linux-x64.tar.gz";