Skip to content

Instantly share code, notes, and snippets.

View cychiuae's full-sized avatar
😎
Bazinga

YinYin Chiu cychiuae

😎
Bazinga
View GitHub Profile
struct TextInput {
let value = BehaviourRelay<String>()
let didChange = PublishRelay<String>()
}
let input1 = TextInput()
let input2 = TextInput()
let input3 = TextInput()
let value1 = BehaviourRelay<String>()
@cychiuae
cychiuae / state.js
Created May 26, 2020 07:48
State Management in every js
window.__state__ = {};
function createStore(key) {
if (window.__state__[key]) {
return window.__state__[key]
}
window.__state__[key] = {};
return window.__state__[key];
}
@cychiuae
cychiuae / blogPost.js
Last active March 22, 2017 10:13
Blog post
// code 0
InteractionManager.runAfterInteractions(() => { /* some operations */ })
// code 1
// In some where
this.props.navigationAction.gotoSellPage()
// navigationAction.js
function gotoSellPage() {
return {
@cychiuae
cychiuae / reactNativeDoubleTap.js
Created July 19, 2016 12:41
Add double tap to react native component
import React from 'react';
import {
TouchableWithoutFeedback,
} from 'react-native';
const DOUBLE_TAP_THRESOLD = 300;
export default function reactNativeDoubleTap(Component) {
return class extends React.Component {