Skip to content

Instantly share code, notes, and snippets.

Shipping stuff

Guilherme Oderdenge chiefGui

Shipping stuff
Block or report user

Report or block chiefGui

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View users.reducer.js
import reswitch from 'reswitch'
import {USERS_GET, USERS_GET__SUCCESS, USERS_GET__FAILURE} from 'consts/users'
const INITIAL_STATE = {areLoading: false, hasError: false, users: null}
const users(state = INITIAL_STATE, action) => reswitch(
{...defaultState, areLoading: true},
View todos.reswitch.js
const todos = (state = INITIAL_STATE, action) => reswitch(
[...state.todos, action.todo],
() => state.todos.filter(todo => !==
)(state, action.type)
View todos.js
const todos = (state = INITIAL_STATE, action) => {
switch (action.type) {
case ADD_TODO:
return [...state.todos, action.todo]
return state.todos.filter(todo => !==
return state
View LightboxHome.jsx
import React from 'react'
class Lightbox extends Component {
constructor () {
this.prev = this.prev.bind(this) =
View Lightbox.jsx
import React from 'react'
const IMAGES = [1, 2, 3]
const Lightbox = ({imageUrl, onPrev, onNext}) => (
return (
<button onClick={onPrev}>Previous</button>
<img src={imageUrl} />
View Sidebar.jsx
import React from 'react'
import Dropdown from '../components/Dropdown'
const Sidebar = ({onClickRegisterButton}) => (
<ul><Dropdown onClickRegisterButton={onClickRegisterButton} /></ul>
View Dropdown.jsx
import React from 'react'
const Dropdown = ({onClickRegisterButton}) => (
<li onClick={onClickRegisterButton}>Two</li>
View Sidebar.jsx
import React from 'react'
const Sidebar = ({onClickRegisterButton}) => (
<ul><li onClick={onClickRegisterButton}>Register</li></ul>
export default Sidebar
View Home.jsx
import React, {Component} from 'react'
import {Header, Sidebar, Body, Content, Footer} from './containers'
import Modal from '../components/Modal'
class Home extends Component {
constructor () {
this.openModal = this.openModal.bind(this)
View Home.demo.jsx
<Header />
<Sidebar />
<Content />
<Footer />
You can’t perform that action at this time.