// when T is any|unknown, Y is returned, otherwise N | |
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
// when T is never, Y is returned, otherwise N | |
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
// when T is a tuple, Y is returned, otherwise N | |
// valid tuples = [string], [string, boolean], | |
// invalid tuples = [], string[], (string | number)[] |
const thenify = require('thenify') | |
const webpack = require('webpack') | |
const MemoryFS = require('memory-fs') | |
const validateNpmPackageName = require('validate-npm-package-name') | |
class InstallMissingModules { | |
constructor(options) { | |
this.options = options | |
} |
Angular 2 uses observables for many features and has a peer dependency on RxJs for its robust API around observables. The community has adopted a single store approach for dealing with state in modern applications. Let's build a store for our Angular applications that is both reactive and easy to use with RxJs.
We'll create this store with intentions on it being the only store in our app. By doing this, we can provide a better experience and lower the difficulty of reasoning about state in our app, because all the state is in one place! First we'll create the provider for the store itself.
export class AppStore {}
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
#!/bin/bash | |
# git-cleanup-repo | |
# | |
# Author: Rob Miller <rob@bigfish.co.uk> | |
# Adapted from the original by Yorick Sijsling | |
git checkout master &> /dev/null | |
# Make sure we're working with the most up-to-date version of master. | |
git fetch |