Before (using react prop types)
import React, { PropTypes } from 'react';
import styled, { css } from 'styled-components';
const styles = css`
text-align: left;
padding: 0.75em;
`;| <style id="jsbin-css"> | |
| body { | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| pre { | |
| flex: 1; | |
| background-color: #eee; | |
| } | |
| </style> |
Before (using react prop types)
import React, { PropTypes } from 'react';
import styled, { css } from 'styled-components';
const styles = css`
text-align: left;
padding: 0.75em;
`;| var sphero = require('sphero-pwn'), | |
| exec = require('exec'), | |
| macros = require('sphero-pwn-macros'), | |
| keypress = require("keypress"); | |
| var orb = null, | |
| id = 'ble://##:##:##:##:##:##'; | |
| var awsIot = require('aws-iot-device-sdk'); |
| var Rx = require('rxjs'); | |
| var firebase = require('firebase'); | |
| firebase.initializeApp({ | |
| "databaseURL": "https://quiver-two.firebaseio.com", | |
| "serviceAccount": "./service-account.json" | |
| }); | |
| var ref = firebase.database().ref('rxjs-demo'); | |
| Rx.Observable.fromPromise(ref.remove()) | |
| .map(function () { |
| { | |
| "_id": { | |
| "$oid": "5844ca3c1bf21197c55cd8a8" | |
| }, | |
| "season": 2016, | |
| "seasonType": "REG", | |
| "week": 13, | |
| "gameScores": [ | |
| { | |
| "gameSchedule": { |
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
| import React, { Component } from 'react'; | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import Rx from 'rx-lite'; | |
| class App extends Component { | |
| componentWillMount() { | |
| const getGames = week => | |
| fetch(`http://localhost:8080/nfl_games/2016/REG/${week}`) | |
| .then(res => res.json()) |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta name="description" content="RxJS"> | |
| <meta charset="UTF-8"> | |
| <title>Weather Monitoring in RxJS</title> | |
| <style> | |
| #form { | |
| margin-bottom: 20px; | |
| } |
| javascript: (function () { | |
| var jsCode = document.createElement('script'); | |
| jsCode.setAttribute('src', 'https://cdn.rawgit.com/msell/5142b6748b251eff6994ad3b94cd8684/raw/485600bca458207988b7487431b24d26326c11da/dnm.js'); | |
| document.body.appendChild(jsCode); | |
| }()); |