This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import TodoList from './TodoList' | |
class TodoApp extends React.Component { | |
constructor (props) { | |
super(props) | |
this.state = { | |
items: [], |