Skip to content

Instantly share code, notes, and snippets.

View Nitemaeric's full-sized avatar

Daniel Dye Nitemaeric

View GitHub Profile
import request from 'superagent'
import Cookies from 'js-cookie'
// CONSTANTS
// ====================
const SIGN_IN = 'SIGN_IN'
const SIGN_IN_SUCCEEDED = 'SIGN_IN_SUCCEEDED'
const SIGN_IN_FAILED = 'SIGN_IN_FAILED'
const BASE_HOST = 'https://api.example.com'
<template>
<div v-if="hidden">
<h1>Here is the {{title}}</h1>
<div v-if="expanded">
<p>Here is the extended description of something</p>
<button v-on:click="onClick">Do Something</button>
</div>
</div>
import React from 'react'
import PropTypes from 'prop-types'
class ConditionalComponent extends React.Component {
static propTypes = {
title: PropTypes.string,
hidden: PropTypes.bool,
expanded: PropTypes.bool,
onClick: PropTypes.func
@Nitemaeric
Nitemaeric / TodoApp.jsx
Last active January 2, 2019 08:28
React TodoApp Example
import React from 'react'
import TodoList from './TodoList'
class TodoApp extends React.Component {
constructor (props) {
super(props)
this.state = {
items: [],