Skip to content

Instantly share code, notes, and snippets.

View timkindberg's full-sized avatar

Tim Kindberg timkindberg

View GitHub Profile
@timkindberg
timkindberg / app.ts
Created December 9, 2015 16:06
Example of Directives Injecting Directives
import {Component, bootstrap} from 'angular2/angular2';
import {Tabs} from "./Tabs";
import {Tab} from "./Tab";
@Component({
selector: 'hello-app',
directives: [Tabs, Tab],
template: `
// Doesn't work
<div tabs>
@timkindberg
timkindberg / angular2.md
Last active February 10, 2016 01:56
Angular 2

Angular 2

A balance of power and simplicity.

Developed by True Stewards:

  • Angular 2 is a careful, methodical reinvention of a mature, comprehensive framework.
  • Transparent and take community feedback and contributions.
  • Google
  • Performance driven development.
  • Embraces web standards and web-component-friendly.
@timkindberg
timkindberg / minimal_jsbin.js
Created February 23, 2017 13:45
Minimal JSBin TamperMonkey Script
// ==UserScript==
// @name Minimal JSBin
// @namespace http://egghead.io/
// @version 0.1
// @description Hide distractions in jsbin to help learners focus on taught content
// @author Tim Kindberg
// @include https://jsbin.com*
// @grant none
// ==/UserScript==
@timkindberg
timkindberg / react-query-portable-api-object.md
Created July 21, 2022 00:24
React Query Portable API Object Pattern

A New Portable API Object

What if we could construct an object that described everything about the fetch and query all together in a single object. And that object could be ultra-portable, able to be passed to any sort of functions such as:

  • useQuery(<new api object>) - declarative hook-fetched data
  • fetchQuery(<new api object>) - imperative method-fetched data
  • prefetchQuery(<new api object>) - imperative method-fetched data for SSR cache
  • invalidateQuery(<new api object>) - invalidate the api's cache key
  • mockApiResponse(<new api object>) - mock the api for a test