Skip to content

Instantly share code, notes, and snippets.

View RafalFilipek's full-sized avatar
😱

Rafau RafalFilipek

😱
View GitHub Profile

In this example I have two base classes foo and bar.

const foo = css`
  color: red;
`;

const bar = css`
color: blue;
`;
import { css } from 'emotion';
import styled from 'react-emotion';
const box = props => css`
composes:
${display(props)}
${flex(props)}
${direction(props)}
${alignItems(props)}
${alignSelf(props)}
<div>
<p>
My twitter account: <a href="https://twitter.com/rafalfilipek">rafal</a>
</p>
</div>
import React from 'react';
import { render } from 'react-dom';
import styled from 'styled-components';
const fontSizes = {
small: 10,
medium: 15,
big: 20,
};
@RafalFilipek
RafalFilipek / lorem.gql
Created October 24, 2016 11:16
Lorem Ipsum GraphQL
type Letter {
value: String
code: Int
}
type Word {
value: String,
letters: [Letter],
}
interface Window {
Promise: PromiseConstructor;
}
declare var require: {
(path: string): any;
<T>(path: string): T;
(paths: string[], callback: (...modules: any[]) => void): void;
ensure: (paths: string[], callback: (require: <T>(path: string) => T) => void) => void;
};
pure(
compose(
lifecycle({
componentWillMount: () => {
console.log(this, this.state, this.props); // function _class, undefined, undefined
},
componentDidMount: () => {
console.log(this, this.state, this.props); // function _class, undefined, undefined
},
})
class Foo extends React.Component {
state = {}
bar = (i) => {
this.setState({ a: i })
}
render() {
return <Biz onClick={this.bar} />
}
}
import React, { PropTypes } from 'react'
import { pure, mapProps, compose, withState, lifecycle, setDisplayName, setPropTypes, defaultProps, onlyUpdateForPropTypes } from 'recompose'
import { repeat } from 'lodash'
export default pure(
compose(
setDisplayName('Loader'),
onlyUpdateForPropTypes,
setPropTypes({
sign: PropTypes.string,
@RafalFilipek
RafalFilipek / test.js
Last active March 1, 2016 08:55
babel 6.6
// input
export const foo = (bar = 1) => {
console.log(bar)
}
//output
"use strict";
var _arguments = arguments; // ???
exports.__esModule = true;