This file contains 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 DecrementAction extends Error {} | |
class IncrementAction extends Error {} | |
const reducer = (state, error) => { | |
switch (error.constructor) { | |
case DecrementAction: | |
return state - 1 | |
case IncrementAction: | |
return state + 1 |
This file contains 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 { Gmaps, Marker } from 'react-gmaps'; | |
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 | |
}; | |
const beach = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'; |
This file contains 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 proxied = target => { | |
const handler = { | |
get(target, key) { | |
if (typeof target[key] === 'function') { | |
return function (...args) { | |
const result = target[key].apply(this, args) | |
console.log('function', key, args, result) | |
return result | |
} | |
} |
This file contains 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 {Gmaps, Marker, InfoWindow} from 'react-gmaps'; | |
const points = [{ | |
lat: 51.5258541, | |
lng: -0.09040660000006028 | |
}, { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 |
This file contains 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 {Gmaps, Marker, InfoWindow} from 'react-gmaps'; | |
const points = [{ | |
lat: 51.5258541, | |
lng: -0.09040660000006028 | |
}, { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 |
This file contains 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 {Gmaps, Marker} from 'react-gmaps'; | |
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 | |
}; | |
const Map = React.createClass({ |
This file contains 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 {Gmaps, Marker, InfoWindow} from 'react-gmaps'; | |
const points = [{ | |
lat: 51.5258541, | |
lng: -0.09040660000006028 | |
}, { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 |
This file contains 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 App = React.createClass({ | |
render() { | |
return ( | |
<Repeat collection={[1, 2]}> | |
{item => <div>{item}</div>} | |
</Repeat> | |
); | |
} | |
}); |
This file contains 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 {Gmaps, Marker} from 'react-gmaps'; | |
const coords = { | |
lat: 51.5258541, | |
lng: -0.08040660000006028 | |
}; | |
const App = React.createClass({ |
This file contains 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 {Gmaps} from 'react-gmaps'; | |
const App = React.createClass({ | |
getInitialState() { | |
return { | |
isMapCreated: false | |
}; |