All of the following information is based on go version go1.8.3 darwin/amd64
.
(Bold = supported by go
out of the box, ie. without the help of a C compiler, etc.)
android
darwin
#! /usr/bin/env node | |
const mason = require('commander'); | |
const { version } = require('./package.json'); | |
const console = require('console'); | |
// commands | |
const create = require('./commands/create'); | |
const setup = require('./commands/setup'); |
const { parentPort } = require('worker_threads'); | |
function random(min, max) { | |
return Math.random() * (max - min) + min | |
} | |
const sorter = require("./test2-worker"); | |
const start = Date.now() | |
let bigList = Array(1000000).fill().map( (_) => random(1,10000)) |
const { Worker, isMainThread, parentPort, workerData } = require('worker_threads'); | |
const request = require("request"); | |
function startWorker(path, cb) { | |
let w = new Worker(path, {workerData: null}); | |
w.on('message', (msg) => { | |
cb(null, msg) | |
}) | |
w.on('error', cb); | |
w.on('exit', (code) => { |
const { Worker, isMainThread, parentPort, workerData } = require('worker_threads'); | |
const request = require("request"); | |
if(isMainThread) { | |
console.log("This is the main thread") | |
let w = new Worker(__filename, {workerData: null}); | |
w.on('message', (msg) => { //A message from the worker! | |
console.log("First value is: ", msg.val); |
const { Worker, isMainThread, workerData } = require('worker_threads'); | |
let currentVal = 0; | |
let intervals = [100,1000, 500] | |
function counter(id, i){ | |
console.log("[", id, "]", i) | |
return i; | |
} |
import React from 'react'; | |
import * as My from './components/my-components.js'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<div> | |
<My.Foo /> | |
<My.Bar /> |
import {withRouter} from 'react-router-dom'; | |
class App extends React.Component { | |
constructor() { | |
super(); | |
this.state = {path: ''} | |
} | |
componentDidMount() { | |
let pathName = this.props.location.pathname; |
class Counter extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0, | |
}; | |
} | |
increment = () => { | |
this.setState(prevState => { |