This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <reference path="../../tools/typings/firebase/firebase.d.ts"/> | |
| module Chat { | |
| class ChatMessage { | |
| constructor(public name:string, public text:string) { | |
| } | |
| } | |
| export class ChatEngine { | |
| private static baseUrl = "<Your Firebase URL>"; | |
| private firebase; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface FirebaseQuery { | |
| /** | |
| * Listens for data changes at a particular location. | |
| */ | |
| on(eventType: string, callback: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: (error: any) => void, context?: Object): (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void; | |
| } | |
| interface Firebase extends FirebaseQuery { | |
| /** | |
| * Generates a new child location using a unique name and returns a Firebase reference to it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Both approaches from https://github.com/yarnpkg/yarn/issues/1326 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fetch from "fetch"; | |
| class WebScraper { | |
| public download(link) { | |
| const page = fetch(link); | |
| if (page.status === "OK") { | |
| this.cache.add(link, page); | |
| } else { | |
| this.scheduler.schedule(link); | |
| } |
OlderNewer