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 Weather from './Weather' | |
import './App.css'; | |
function App() { | |
const [counter, setCounter] = useState(0) | |
const [weather] = useState({city:'Miami', temperature:'80F'}) | |
return ( | |
<div className="App"> | |
<Weather weather={weather} /> |
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' | |
const Weather = ({weather}) => { | |
return ( | |
<div> | |
<p>{weather.city}</p> | |
<p>{weather.temperature}</p> | |
{console.log('Render')} | |
</div> | |
) |
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
function inclusiveArrayParamRecursive(startVal, endVal) { | |
if(startVal >= endVal) { | |
return [startVal] | |
} else { | |
const arr = inclusiveArrayParamRecursive(startVal, endVal - 1) | |
arr.push(endVal) | |
return arr | |
} | |
} |
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
function inclusiveArrayParam(startVal, endVal) { | |
const arr = [] | |
for(let i = startVal; i <= endVal; i++) { | |
arr.push(i) | |
} | |
return arr | |
} | |
console.log('iterative inclusive array solution: ', inclusiveArrayParam(2, 6)) |
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
//grabbing the dom ids: | |
const convertKelvin = document.querySelector('#convertKelvin') | |
const results = document.querySelector('#results') | |
const kelvinNumber = document.getElementById('kelvinNumber') | |
convertKelvin.onclick = () => { | |
console.log('test') | |
//convertKelvinReg(300) | |
const currier = convertKelvinCurried(kelvinNumber.value)() | |
currier |
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
//grabbing the dom ids: | |
const convertKelvin = document.querySelector('#convertKelvin') | |
const results = document.querySelector('#results') | |
const kelvinNumber = document.getElementById('kelvinNumber') | |
convertKelvin.onclick = () => { | |
console.log('test') | |
//convertKelvinReg(300) | |
const currier = convertKelvinCurried(kelvinNumber.value)() | |
currier |
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
//grabbing the dom ids: | |
const convertKelvin = document.querySelector('#convertKelvin') | |
const results = document.querySelector('#results') | |
const kelvinNumber = document.getElementById('kelvinNumber') | |
convertKelvin.onclick = () => { | |
console.log('test') | |
convertKelvinReg(300) | |
} |
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
//grabbing the dom ids: | |
const convertKelvin = document.querySelector('#convertKelvin') | |
const results = document.querySelector('#results') | |
const kelvinNumber = document.getElementById('kelvinNumber') | |
convertKelvin.onclick = () => { | |
console.log('test') | |
} |
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
<!DOCTYPE html> | |
<html lang="en" > | |
<head> | |
<meta charset="UTF-8"> | |
<title>Currying Example</title> | |
</head> | |
<body> | |
<div id="DOM"> |
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,{useContext} from 'react' | |
import PropTypes from 'prop-types' | |
import { connect } from 'react-redux' | |
import { addToCart } from '../actions' | |
import { getVisibleProducts } from '../reducers/products' | |
import ProductItem from '../components/ProductItem' | |
import ProductsList from '../components/ProductsList' | |
import {ProductsContext} from '../provider/products.provider' | |
const ProductsContainer = ({ addToCart }) => { |
NewerOlder