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 dispatch(action) { | |
| // Promise tracker middleware | |
| const nextAction = reduxThunkMiddleware(action) | |
| // Because react-thunk returns the result of the | |
| // thunk, our async function returns a promise | |
| // Which means this statement will be true | |
| if (Promise.resolve(nextAction) === nextAction) { | |
| // Tracking a promise is a side effect of our middleware | |
| track(nextAction) |
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
| export class PromiseTracker { | |
| promises = [] | |
| track(promise) { | |
| this.promises.push(promise) | |
| } | |
| middleware() { | |
| return () => next => (action) => { | |
| const result = next(action) |
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
| ReactDOM.hydrate(<MyApp />, document.getElementById('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 wrapper = fixture.mountUrl('/business') | |
| await fixture.processEvents() | |
| const allLimas = wrapper.update().find(Lima) | |
| expect(allLimas.length).toBeGreaterThan(0) | |
| const bullsNBears = allLimas.filterWhere(limas => { | |
| const props = limas.props() | |
| if (!props.sectionHeader) { | |
| return false | |
| } |
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, { Component } from "react"; | |
| import "./App.css"; | |
| import { fetchAgenda, talkShape } from "./fetch-agenda"; | |
| import { groupBy, formatTime } from "./utils"; | |
| import { Talk } from "./components/talk"; | |
| class App extends Component { | |
| state = { | |
| talks: [] | |
| }; |
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, { Component } from 'react'; | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import { fetchAgenda } from './agenda' | |
| import _ from 'lodash' | |
| const Talk = ({ startTime, title }) => ( | |
| <div>{title}</div> |
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 cheerio from 'cheerio' | |
| export const fetchAgenda = () => { | |
| return fetch('http://ndcsydney.com/agenda') | |
| .then(r => r.text()) | |
| .then(body => { | |
| const talks = [] | |
| const $ = cheerio.load(body) | |
| $('section.day').map((i, el) => { |
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 * as cheerio from 'cheerio' | |
| export type Time = { | |
| hour: number | |
| minutes: number | |
| } | |
| export type Talk = { | |
| startTime: Time | |
| endTime: Time |
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
| public static class LogHelper | |
| { | |
| static readonly ConcurrentDictionary<Guid, ITestOutputHelper> LoggerLookup = new ConcurrentDictionary<Guid, ITestOutputHelper>(); | |
| public static void Log(string log) | |
| { | |
| var currentCorrelationId = (Guid?)CallContext.LogicalGetData("TestCorrelationId"); | |
| if (currentCorrelationId == null) | |
| return; |
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
| var Col = require('react-bootstrap/lib/Col') | |
| var PageHeader = require('react-bootstrap/lib/PageHeader') | |
| var React = require('react') | |
| var Row = require('react-bootstrap/lib/Row') | |
| var {connect} = require('react-redux') | |
| var {reduxForm} = require('redux-form') | |
| var DateInput = require('./DateInput') | |
| var FormField = require('./FormField') | |
| var LoadingButton = require('./LoadingButton') |