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 { render } from 'react-dom' | |
import { createStore, applyMiddleware } from 'redux' | |
import { Provider } from 'react-redux' | |
import { createLogger } from 'redux-logger' | |
import thunk from 'redux-thunk' | |
import reducer from './reducers' | |
import { getAllProducts } from './actions' | |
import App from './containers/App' | |
import ProductsProvider from './provider/products.provider' |
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 = ({ products, addToCart }) => { |
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,{createContext, useState, useEffect} from 'react' | |
import shop from '../api/shop' | |
export const ProductsContext = createContext({ | |
test: '', | |
products: [] | |
}) | |
const ProductsProvider = ({children}) => { | |
const [test] = useState('the products provider has been successfully connected :)') |
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 }) => { |
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
//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
//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') | |
//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
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)) |