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
| /** | |
| * Component module to enforce model update view | |
| */ | |
| import xs, {MemoryStream, Stream} from 'xstream'; | |
| import {DOMSource, VNode} from '@cycle/dom'; | |
| import {Record} from 'immutable'; | |
| export interface ComponentSource { DOM: DOMSource } |
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
| const applu = require('./index'); | |
| const html = ` | |
| <html> | |
| <head></head> | |
| <body> | |
| <p id="content"></p> | |
| <body> | |
| </html> | |
| `; |
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
| // Generated by JSIL v0.8.2 build 13182. See http://jsil.org/ for more information. | |
| 'use strict'; | |
| var $asm00 = JSIL.GetAssembly("1dd27d7b, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); | |
| var $asm01 = JSIL.GetAssembly("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); | |
| var $asm02 = JSIL.GetAssembly("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); | |
| /* Generated by JSIL v0.8.2 build 13182. See http://jsil.org/ for more information. */ | |
| 'use strict'; | |
| var $asm00 = JSIL.DeclareAssembly("1dd27d7b, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); |
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
| class Polynomial: | |
| def __init__(self, coefficient, exponent, next = None): | |
| self.coefficient = coefficient | |
| self.exponent = exponent | |
| self.next = next | |
| def _add(term_a, term_b): | |
| if term_a == None: | |
| return term_b |
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
| export async function sequentially<T, R>(list: T[], asyncFunction: (t: T) => Promise<R>) { | |
| const newList = [] as R[]; | |
| for (const i of list) { | |
| newList.push(await asyncFunction(i)); | |
| } | |
| return newList; | |
| } | |
| /* | |
| // then use like so: |
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
| <html> | |
| <head> | |
| <title>what up</title> | |
| </head> | |
| <body> | |
| <h1 class="foo"></h1> | |
| <div class="stuff"></div> | |
| <script> | |
| async function loadData() { | |
| const response = await fetch('https://api.github.com/users/ricokahler/gists'); |
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
| class Something { | |
| foo: string; | |
| bar: string; | |
| x: number; | |
| constructor(x: number) { | |
| this.x = x; | |
| this.foo = 'foo'; | |
| this.bar = 'bar'; | |
| } | |
| } |
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
| node_modules |
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 Request { | |
| queries: Array<Query>; | |
| filters?: Filter; | |
| } | |
| interface Response extends Array<Result> {} | |
| interface Result { | |
| id: string; | |
| results: Array<number>; |
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 React, { useCallback } from 'react'; | |
| function usePullValue(value) { | |
| const ref = useRef(value); | |
| useLayoutEffect(() => { | |
| ref.current = value; | |
| }, [value]); | |
| return useCallback(() => { |
OlderNewer