I hereby claim:
- I am ajwhite on github.
- I am atticoos (https://keybase.io/atticoos) on keybase.
- I have a public key ASA-781KbuC64otQfuCRKhdnIYG4HyAhFtHIykiS3liNhAo
To claim this, I am signing this object:
test('monkey-patches `theme` into user defined context', () => { | |
const Child = glamorous.div((props, context) => ({ | |
fontSize: context.theme.fontSize, | |
color: context.userTheme.color, | |
})) | |
Child.contextTypes = { | |
userTheme: PropTypes.object, | |
} | |
const context = { |
import glamorous from 'glamorous-native' | |
const style = StyleSheet.create({ | |
baseStyle: { | |
color: '#333', | |
// some other "base styles" | |
} | |
}) | |
const Text = glamorous.text( |
// | |
// AppDelegate.m | |
// RXTesting | |
// | |
// Created by Atticus White on 2/1/17. | |
// Copyright © 2017 Atticus White. All rights reserved. | |
// | |
#import "AppDelegate.h" | |
#import <ReactiveCocoa/ReactiveCocoa.h> |
var count = 0; | |
function increment (amount) { | |
count = count + 1; | |
return count; | |
} | |
increment(1) // 1 | |
increment(1) // 2 | |
increment(1) // 3 |
const todoStore = new Store([]); | |
const add = newTodo => todos => todos.concat(newTodo); | |
const remove = oldTodo => todos => todos.filter(todo => todo !== oldTodo); | |
todoStore.subscribe(state => { | |
// rerender a UI with new state | |
console.log('next state', state); | |
}) |
import {createReducer} from 'rxjs-store'; | |
const TodoActions = { | |
add: newItem => items => items.concat(newItem), | |
remove: oldItem => items => items.filter(item => item !== oldItem); | |
}; | |
const todos = createReducer(TodoActions, []); | |
// Pass these to a <Provider /> and you're done |
const double = n => n * 2; | |
const doublePoints = obj => double(obj.points); | |
const doubleMap = numbers => numbers.map(doublePoints); | |
console.log(doubleMap([ | |
{ name: 'ball', points: 2 }, | |
{ name: 'coin', points: 3 }, | |
{ name: 'candy', points: 4} |
import render from './render'; | |
class Element extends React.Component { | |
render () { | |
return ( | |
<span>[this.context.foobar}</span> | |
); | |
} | |
} | |
const Status = { | |
REQUEST: 'requrest', | |
SUCCESS: 'success', | |
FAILURE: 'failure' | |
}; | |
function requestAction (payload, type) { | |
return { | |
...payload, | |
status: Status.REQUEST, |
I hereby claim:
To claim this, I am signing this object: