Skip to content

Instantly share code, notes, and snippets.

View thulioph's full-sized avatar
🔥

Thulio Philipe thulioph

🔥
View GitHub Profile
@thulioph
thulioph / branch.js
Last active September 13, 2018 03:52
An example to demonstrate the branch API of Recompose
import React from 'react';
import { branch } from 'recompose';
const MyComponent = () => <h2>Hello!</h2>;
const IsLessThanZero = BaseComponent => props => (
<div>
<BaseComponent {...props} />
<h1>Less or equal than zero!</h1>
</div>
@thulioph
thulioph / withState.js
Last active September 13, 2018 03:43
An example to demonstrate the withState API of Recompose
import React from 'react';
import { withState } from 'recompose';
const MyComponent = ({ counter, setCounter }) => (
<div>
<h1>{counter}</h1>
<button onClick={() => setCounter(counter + 1)}>Add</button>
<button onClick={() => setCounter(counter - 1)}>Remove</button>
</div>
);
@thulioph
thulioph / lifecycle.js
Last active September 11, 2018 03:22
An example to demonstrate the lifecycle API of Recompose
import React from 'react';
import { lifecycle } from 'recompose';
const MyComponent = ({ data }) => (
<div>{data}</div>
);
const MyComponentModified = lifecycle({
componentDidMount() {
doSomething().then(data => {
$ brew install -v libxmlsec1
==> Installing dependencies for libxmlsec1: libunistring, p11-kit
rm /usr/local/include/unicase.h
rm /usr/local/include/uniconv.h
rm /usr/local/include/unictype.h
rm /usr/local/include/unigbrk.h
rm /usr/local/include/unilbrk.h
rm /usr/local/include/uniname.h
rm /usr/local/include/uninorm.h
rm /usr/local/include/unistdio.h
@thulioph
thulioph / config.yml
Created March 20, 2018 22:54
Code snippet from post about CircleCI with React - sequential workflow II
version: 2
jobs:
build:
docker:
- image: circleci/node:8.2.1
steps:
- checkout
- run: echo "My first job is build."
test:
steps:
@thulioph
thulioph / config.yml
Created March 20, 2018 22:45
Code snippet from post about CircleCI with React - sequential workflow
version: 2
jobs:
build:
docker:
- image: circleci/node:8.2.1
steps:
- checkout
- run: echo "My first job is build."
test:
steps:
@thulioph
thulioph / config.yml
Last active March 20, 2018 22:41
Code snippet from post about CircleCI with React - parallel workflow
version: 2
jobs:
build:
docker:
- image: circleci/node:8.2.1
steps:
- checkout
- run: echo "My first job is build."
test:
steps:
@thulioph
thulioph / config.yml
Last active March 20, 2018 22:18
Code snippet from post about CircleCI with React - jobs
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.4.1
steps:
- checkout
- run: echo "A first hello"