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
name: Detox | |
on: [push] | |
jobs: | |
build: | |
runs-on: macOS-latest | |
timeout-minutes: 15 | |
env: |
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
background: linear-gradient(to right, #80cdec 29%, #c00f2d 126%, #c00f2d 126%); |
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 { useEffect, useRef, useState } from 'react' | |
import { getDocumentScrollPos } from '../helpers/getDocumentScrollPos' | |
import isPassiveSupported from '../helpers/isPassiveSupported' | |
type AxisName = 'x' | 'y' | |
type ScrollDir = '' | 'positive' | 'negative' | |
interface ScrollDirState { | |
dir: ScrollDir | |
hitThreshold: boolean | |
isAtMin: boolean |
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
const DECAY_FAST = 0.99 | |
const DECAY_NORMAL = 0.998 | |
const projection = (velocityPxMs: number) => (velocityPxMs * DECAY_FAST) / (1 - DECAY_FAST) |
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 name="description" content="Touchpad pinch demo" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
http://experimental.mural.ly/vnext-mural/sticky/200/webglbody { | |
-ms-scroll-rails: none; | |
} |
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
/** | |
* Copyright (c) 2015, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
* | |
* @providesModule normalizeWheel | |
* @typechecks |
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
/* | |
tyescript different sets of parameters OR function signature | |
*/ | |
interface foo { | |
foo1: string | |
foo2: string | |
blubb: string | |
} | |
interface bar { |
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
interface foo { | |
foo1: string | |
foo2: string | |
blubb: string | |
} | |
interface bar { | |
bar1: number | |
bar2: number | |
blubb: number |
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
/** | |
* Optional Chaining in Typescript | |
* lets you safely access nested properties, while preserving type information | |
* | |
* Usage: | |
* type TData = { foo: Optional<{ bar: Optional<number> }> } | |
* const data: TData = { foo: undefined } | |
* const num = optionalChain(() => data.foo!.bar) | |
*/ | |
type Optional<T> = T | undefined |
NewerOlder