(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* This is a Live Query polyfill, as graphql-js does not strictly have support for that. Instead, we leave it up to the | |
* client to recognize a Live Query is requested with the `@live` directive on a `query` operation and here we | |
* transform it into a `live` subscription instead. | |
* | |
* Consider a schema like the following: | |
* | |
* ```graphql | |
type Badge { | |
id: ID! |
'use strict' | |
var sqlite = require('sqlite3').verbose(); | |
var db = new sqlite.Database('test_db'); | |
db.getAsync = function (sql) { | |
var that = this; | |
return new Promise(function (resolve, reject) { | |
that.get(sql, function (err, row) { | |
if (err) |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import configureStore from "./store/configureStore"; | |
const store = configureStore(); | |
const rootEl = document.getElementById("root"); |
license: gpl-3.0 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
// stream.ts - A TypeScript module for FRP. | |
// - https://gist.github.com/hisui/6261547 | |
// - tsc stream.ts -t es5 --sourcemap --noImplicitAny | |
module sf { | |
export class Packet<T> { | |
constructor(private _flags:number, private _value:any=void 0) {} | |
static next<A>(e:A):Packet<A> { |