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
//let stepOptions = options.slice(0, options.length); | |
let stepOptions = options.map(({title}, i) => { title, index: [i] }); | |
stepOptions.splice(1, 0, { title: 'Best of Both', index: [0, 1] }); | |
{stepOptions.map((({title, index}), i) => <CheckBox label={title} key={i} value={this.isSelected(index)} onChange={() => onChange(index)} />)} | |
isSelected(index) { | |
const { value } = this.props; | |
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
class Test { | |
tokens$: Observable; | |
message$: Observable; | |
constructor() { | |
this.tokens = Observable.create((observer) => { | |
this.getToken(observer); | |
this.messaging.onTokenRefresh(() => this.getToken(observer)); | |
}); |
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
/* (...) */ | |
show(toValue, cb) { | |
return Animated.timing(this.animation, { | |
toValue, | |
duration, | |
easing: Ease.ease(Ease.out) | |
}).start(({finished}) => finished && cb); | |
} | |
/* (...) */ | |
show(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
... | |
renderHeader() { | |
return ( | |
<View> | |
<Text>{`Header`}</Text> | |
</View> | |
) | |
} | |
... | |
render() { |
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 UIKit | |
import NativeNavigation | |
import React | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate, RCTBridgeDelegate, ReactNavigationCoordinatorDelegate { | |
/*...*/ | |
func flowCoordinatorForId(_ name: String) -> ReactFlowCoordinator? { |
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
static class Easing { | |
// no easing, no acceleration | |
static linear(t) { return t; } | |
// accelerating from zero velocity | |
static easeInQuad(t) { return t*t; } | |
// decelerating to zero velocity | |
static easeOutQuad(t) { return t*(2-t); } | |
// acceleration until halfway, then deceleration | |
static easeInOutQuad(t) { return t<0.5 ? 2*t*t : -1+(4-2*t)*t; } | |
// accelerating from zero velocity |
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 java.util.ArrayList; | |
import java.util.HashMap; | |
public class NotificationCenter { | |
//static reference for singleton | |
private static NotificationCenter _instance; | |
private HashMap<String, ArrayList<Runnable>> registredObjects; |
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 MatrixMath from 'react-native/Libraries/Utilities/MatrixMath'; | |
class TransformUtil { | |
constructor(matrix) { | |
this.matrix = matrix || MatrixMath.createIdentityMatrix(); | |
} | |
perpective(x) { | |
MatrixMath.reusePerspectiveCommand(this.matrix, x) |
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
class Dispatcher { | |
id = 0; | |
_callbacks = []; | |
register(callback){ | |
const id = this.id + 1; | |
this._callbacks[id] = callback; | |
return id; | |
} |
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'; | |
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
Animated, | |
Easing | |
} from 'react-native'; |