This file contains hidden or 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
let events = this.contract.allEvents(); | |
events.watch((err, event)=>{ | |
if(event.event === "Log") { | |
console.log(`[EVENT] ${event.args.name}: ${event.args.value.toString(10)}`) | |
} | |
}) |
This file contains hidden or 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
--unsafe-perm=true --allow-root |
This file contains hidden or 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
const myApp = require('../server.js'); | |
const request = require('supertest')(myApp); | |
const chai = require('chai'); | |
chai.use(require('chai-json-schema')) | |
const expect = chai.expect; | |
describe('serverApi', function () { | |
const postBody = { pvtKey: "9a8de2c8850f5c499e06596dae72302968c2b919870cb884062198f4ff7a7a83" }; |
This file contains hidden or 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
const PropTypes = require('prop-types'); | |
class MediaQuery extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {type:'desktop'}; | |
} | |
getChildContext() { | |
return {type: this.state.type}; |
This file contains hidden or 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
function CustomTextInput(props) { | |
return ( | |
<div> | |
<input ref={props.inputRef} /> | |
</div> | |
); | |
} | |
class Parent extends React.Component { | |
render() { |
This file contains hidden or 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 PropTypes from 'prop-types'; | |
MyComponent.propTypes = { | |
// You can declare that a prop is a specific JS primitive. By default, these | |
// are all optional. | |
optionalArray: PropTypes.array, | |
optionalBool: PropTypes.bool, | |
optionalFunc: PropTypes.func, | |
optionalNumber: PropTypes.number, | |
optionalObject: PropTypes.object, |
This file contains hidden or 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
// Calls the children callback numTimes to produce a repeated component | |
function Repeat(props) { | |
let items = []; | |
for (let i = 0; i < props.numTimes; i++) { | |
items.push(props.children(i)); | |
} | |
return <div>{items}</div>; | |
} | |
function ListOfTenThings() { |
This file contains hidden or 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 { BrowserRouter as Router, Link, Route } from 'react-router-dom'; | |
import Footer from './Footer'; | |
import Header from './Header'; | |
import Todos from './Todos'; | |
import Articles from './Articles'; | |
export default class Layout extends React.Component { | |
constructor() { | |
super(); |
This file contains hidden or 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 ReactDOM from 'react-dom'; | |
import PropTypes from 'prop-types'; | |
import './App.css' | |
//const App = () => <h1>Hello stateless</h1> | |
class App extends React.Component { | |
constructor() { | |
super(); |
This file contains hidden or 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
function SplitPane(props) { | |
return ( | |
<div className="SplitPane"> | |
<div className="SplitPane-left"> | |
{props.left} | |
</div> | |
<div className="SplitPane-right"> | |
{props.right} | |
</div> | |
</div> |