This file contains 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 { useCallback, useState } from 'react'; | |
import { | |
QueryFunction, | |
QueryKey, | |
useQuery, | |
UseQueryOptions, | |
UseQueryResult, | |
} from 'react-query'; | |
type UseQueryParams = Parameters<typeof useQuery>; |
This file contains 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
'use strict'; | |
var container = document.getElementById('container'); | |
//create resource locally for testing | |
var stylesheet = '#container{background: red; width: 100px; height: 100px; display: block;}'; | |
var sBlob = new Blob([stylesheet], { type: 'text/css' }); | |
//get blob as a blob: url |
This file contains 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
// Returns an array of threats if the arrangement of | |
// the pieces is a check, otherwise false | |
var getMoves = function getMoves(p, board) { | |
var x = p.x; | |
var y = p.y; | |
var getPawnMoves = function getPawnMoves(p, x, y) { | |
if (p.owner == 0) { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.js"></script> |
This file contains 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
abstract class AnimationState { | |
abstract name : string; | |
sprite: Sprite; | |
constructor(context? : Sprite, state? : AnimationState){ | |
if(context) | |
this.sprite = context; | |
else if(state){ |
This file contains 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
"use strict"; | |
var Stream = (function () { | |
function Stream(val) { | |
this._source = new Rx.BehaviorSubject(val); | |
this._obs = this._source.asObservable(); | |
return this._obs; | |
} | |
return Stream; | |
}()); |
This file contains 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
//module test | |
'use strict'; | |
//the namespace that will be exported | |
var myModule = {}; | |
//wrapper function to export all as one namespace | |
(function wrapper(exports) { | |
(function existsModule(exports) { |
This file contains 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
'use strict'; | |
var t = { | |
mutableProp: 'helloWorld' | |
}; | |
//by default Object.defineProperty creates an immutable property that is not enumerable | |
Object.defineProperty(t, 'immutableProp', { | |
value: 'worldHello!', | |
configurable: true |