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, { useState } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
function App() { | |
const notNull = (v) => v ? undefined : 'can\'t be null'; | |
const isChris = (v) => v ? undefined : 'can\'t be chris'; | |
const formInputs = [ | |
{ | |
name: 'firstName', |
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
Step 1: | |
import React, { lazy, Suspense } from 'react'; | |
Step 2: | |
// change this: | |
import BusinessList from 'screens/businesses/list'; | |
// to this: | |
const BusinessList = lazy(() => import('screens/businesses/list')); |
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 debounce from 'lodash/debounce'; | |
import { InfinitePanel } from '../shared'; | |
const withInfiniteScroll = WrappedComponent => class InfiniteScroll extends WrappedComponent { | |
constructor(props) { | |
super(props); | |
this.infiniteRef = React.createRef(); | |
this.debouncedHandleInfiniteScroll = debounce(this.handleInfiniteScroll, 150); | |
} |
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 { Router } from 'react-router-dom'; | |
import { Provider } from 'react-redux'; | |
import history from './config/history'; | |
import httpService from './services/httpService'; | |
import configureStore from './state/store'; | |
import App from './App'; |
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 axios from 'axios'; | |
import { authOperations } from 'where you keep your actions/operations'; | |
// whats a tutorial without an obscure authService :) | |
import authService from './authService'; | |
const httpService = { | |
// we pass the redux store and history in order to dispatch the logout actions | |
// and push the user to login |
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
app.controller('MainController', ['$scope', 'places', function($scope, places){ | |
$scope.mapCenter = { lat: 40.741934, lng: -74.004897, zoom: 17 } | |
console.log('init') | |
places.success(function(data){ | |
console.log('data', data) | |
$scope.geodata = data; | |
$scope.mapMarkers = geodataToMarkers($scope.geodata); | |
}); | |
}]); |
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
<head> | |
<link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet"> | |
<link href="css/main.css" rel="stylesheet" /> | |
<link href="css/leaflet.css" rel="stylesheet" /> | |
<script src='js/vendor/angular.min.js'></script> | |
<script src='js/vendor/leaflet.js'></script> |
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
`Hello, my name is ${this.name}` <---- this ... rather than this ---> 'Hello, my name is ${this.name}' |
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 imAnObj = { | |
thisIsAKeyThatPointsToAnotherObj: { | |
anotherObj: 'This is cray' | |
} | |
} |
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
<div class="main" ng-controller="MainController"> | |
<program-listing listing="program"></program-listing> | |
</div> |