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
.image { | |
background-image: url('original.webp'); | |
} | |
@media (prefers-reduced-data: reduce) { | |
.image { | |
background-image: url('compressed.webp'); | |
} | |
} |
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
name: Node CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-18.04 | |
steps: |
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
// I removed everything bar the component with the binds and hopefully I can just point you in the right direction. | |
// when we look at doctorFormBlocks.map, there's two issues. One being that you're creating a new function instance with your | |
// bind every render (which you correctly identified). But two, your map has an arrow function inside it which also results | |
// a new function instance every render! This would certainly add up. | |
// Below is the class as you had it before. The way I would do it is to just make your map an instance method on | |
// the component. | |
// Before | |
export default class DoctorsPage extends React.Component { |
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
// For each image in the dataset, output this object: | |
// { src: "picture-3.jpg", caption: "Lorem Ipsum Dolor 2<br>Ut enim ad minim veniam, quis nostrud exercitation ullamco<br>2017" } | |
const data = [ | |
{ | |
"title": "Lorem Ipsum Dolor 1", | |
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco.", | |
"year": "2018", | |
"images": [ | |
"picture-1.jpg", |
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(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.someMaths = someMaths; | |
var _someFile = __webpack_require__(1); | |
var _someFile2 = _interopRequireDefault(_someFile); | |
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
module.exports = | |
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { |
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
'use strict'; | |
Object.defineProperty(exports, '__esModule', { value: true }); | |
var multiplier = 10; | |
function someMaths() { | |
console.log(multiplier); | |
console.log(5 * multiplier); | |
console.log(10 * multiplier); |
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 multiplier from './some-file.js'; | |
export function someMaths() { | |
console.log(multiplier); | |
console.log(5 * multiplier); | |
console.log(10 * multiplier); | |
} |
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
export default 10; |
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 path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: { | |
'index.webpack': path.resolve('./src/index.js') | |
}, | |
output: { | |
libraryTarget: "umd", | |
filename: "bundle.webpack.js", |
NewerOlder