Skip to content

Instantly share code, notes, and snippets.

View MrChocolatine's full-sized avatar
Away, unlikely to answer.

MrChocolatine

Away, unlikely to answer.
  • Remote Island
View GitHub Profile
@MrChocolatine
MrChocolatine / TS – Collection of utility types.d.ts
Last active December 3, 2022 15:02 — forked from ClickerMonkey/types.ts
TypeScript – Collection of utility types
// 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)[]
@MrChocolatine
MrChocolatine / emberjs-route_hooks_order.js
Last active October 23, 2021 11:03 — forked from danielchappell/route_hooks.js
Ember.js – Order of Route's lifecycle hooks
import Ember from 'ember';
// Ember 1.10
// Order also respected on Ember v3.16.10
export default Ember.Route.extend({
//---fire in order on route enter---