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, { PropTypes } from 'react'; | |
| import Select from 'react-select'; | |
| import 'react-select/dist/react-select.css'; | |
| RFReactSelect.defaultProps = { | |
| multi: false, | |
| className: "" | |
| }; | |
| RFReactSelect.propTypes = { |
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 { applyMiddleware, createStore } = Redux; | |
| const createSagaMiddleware = ReduxSaga.default; | |
| const { put, call } = ReduxSaga.effects; | |
| const { takeLatest } = ReduxSaga; | |
| const { connect, Provider } = ReactRedux; | |
| // GitHub API | |
| const gitHubApi = (username) => { | |
| return fetch(`https://api.github.com/users/${username}`) | |
| .then(response => { |
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 DataContext = React.createContext(); | |
| class DataContextProvider extends Component { | |
| // We want to be able to store multiple sources in the provider, | |
| // so we store an object with unique keys for each data set + | |
| // loading state | |
| state = { | |
| data: {}, | |
| fetch: this.fetch.bind(this) | |
| }; |
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
| class App extends Component { | |
| render () { | |
| return ( | |
| <Suspense fallback={<p>Loading...</p>}> | |
| <DeepNesting> | |
| <ThereMightBeSeveralAsyncComponentsHere /> | |
| </DeepNesting> | |
| </Suspense> | |
| ); | |
| } |
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
| ipconfig getifaddr en0 |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Minio SDK for JavaScript - Sample Application</title> |
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
| //copy the $file to $dir2 | |
| var copyFile = (file, dir2, fileName)=>{ | |
| //include the fs, path modules | |
| var fs = require('fs'); | |
| var path = require('path'); | |
| //gets file name and adds it to dir2 | |
| var f = path.basename(fileName); | |
| var source = fs.createReadStream(file); | |
| var dest = fs.createWriteStream(path.resolve(dir2, f)); |
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
| async function logInOrder(urls) { | |
| // fetch all the URLs in parallel | |
| const textPromises = urls.map(async url => { | |
| const response = await fetch(url); | |
| return response.text(); | |
| }); | |
| // log them in sequence | |
| for (const textPromise of textPromises) { | |
| console.log(await textPromise); |
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 getResponseSize(url) { | |
| return fetch(url).then(response => { | |
| const reader = response.body.getReader(); | |
| let total = 0; | |
| return reader.read().then(function processResult(result) { | |
| if (result.done) return total; | |
| const value = result.value; | |
| total += value.length; |
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
| #Test |
OlderNewer