10 2018 档案
摘要:A new Higher Order Component (HOC) was recently released in React v16.6.0 called React.memo. This behavior of the HOC is similar to what you’d get whe
阅读全文
摘要:Sorting in Javascript with sort uses lexical sorting by default, which means it will sort in alphabetical order. That's fine for strings of characters
阅读全文
摘要:In this lesson, we’ll get the most fundamental understanding of what an automated test is in JavaScript. A test is code that throws an error when the
阅读全文
摘要:Previous to this post, we set up our own Rust/wasm project from scratch. The Rust/wasm team ships a template for you to get started right away. In thi
阅读全文
摘要:There are three types of Segmentation Hit-based Visit-based Visitor-based There are four segment container types: Visitor (Multi session) Visit (Singl
阅读全文
摘要:Interoperability between JavaScript and Rust is limited to numerics and accessing memory directly. Since this can be exhausting and overwhelming to do
阅读全文
摘要:For small viewports, we may want to show a variation of the desktop image. A very common use case of this is a cropped, smaller version of the desktop
阅读全文
摘要:For small viewports, we want to save bandwidth and we may be dealing with slow speeds; so it's very important that images' filesizes are not too big.
阅读全文
摘要:Npm by default uses global values when initializing a new package.json file. Learn how to set your own global default values by command line or editin
阅读全文
摘要:Do you get lost when working with functions and the new keyword? Prototypal inheritance can be completely replicated without either of those two conce
阅读全文
摘要:In this lesson I demonstrate how to use the library MDXC to create and import React components with Markdown. MDXC converts markdown into JavaScript a
阅读全文
摘要:In some cases it’s useful to be able to invoke a JavaScript function inside Rust. This session showcases how this can be done, by passing along our Ja
阅读全文
摘要:In this lesson, you will learn how to extend styles from one styled-component to another in a React app. This is helpful when you have two styled-comp
阅读全文
摘要:We'll read a csv file in node.js both synchronously, and asynchronously. The file we're reading is a plain text, utf8 file - but you can also use fs.r
阅读全文
摘要:In node.js, you can require fs, and then call fs.writeFile with the filename, and data to write to that file (as a string or a buffer). That will over
阅读全文
摘要:When testing functions that make HTTP requests, it's not preferable for those requests to actually run. Using the nock JavaScript library, we can mock
阅读全文
摘要:Loops can behave differently when objects have chained prototype objects. Let's see the difference we get when we use the for-in loop on an object wit
阅读全文
摘要:Constructor functions hold an interesting purpose in JavaScript. Unlike in classical languages, they do not always mean created by. In this lesson we’
阅读全文
摘要:In this lesson we are going to setup a project from scratch by introducing the JavaScript snippet to load a WebAssembly module. We demonstrate two dif
阅读全文
摘要:In order to setup a project we need to install the nightly build of Rust and add the WebAssembly target. For an improved workflow we also install the
阅读全文
摘要:Objects have the ability to use data and methods that other objects contain, as long as it lives on the [prototype] chain. In this lesson we’ll test t
阅读全文
摘要:create-react-app version 2.0 added a lot of new features. One of the new features is upgrading to Babel Version 7, which enables the Short Syntax of R
阅读全文
摘要:In this lesson, we’ll use grep to find text patterns. We’ll also go over some of the flags that grep has that can be combined together to make it more
阅读全文
摘要:find is a powerful tool that can not only find files but it can run a command on each matching file too. In this lesson, we’ll learn how to find all t
阅读全文
摘要:Using Angular CLI v6, we are able to create library or small application inside a Angular CLI generated application. If for example, the lib logger-li
阅读全文
摘要:In this lesson we’ll learn how to move and rename files (mv) and copy (cp) them. Move index.html to src folder: We can also rename the file: You can a
阅读全文
摘要:We can create a single folder by doing: If we want to create nested folder we need to add '-p' flag: It creates three folders 'a', 'b', 'c'.
阅读全文
摘要:Sometimes when working at the command line, it can be handy to view a file’s contents right in the terminal, or open a file with a certain application
阅读全文
摘要:A component author has no way of knowing which state changes a consumer will want to override, but state reducers handle this problem by allowing the
阅读全文
摘要:If we’re going to make our toggle accessible, we’ll need to apply certain aria attributes to the control that does the toggling. Instead of making the
阅读全文
摘要:Allow the base toggle to be a tag (<toggle>) or attribute (<div toggle>). The <toggle> component has become less opinionated about the view, but has n
阅读全文
摘要:Allow more than one child component of the same type. Allow child components to be placed within the views of other custom components. In previous pos
阅读全文
摘要:Allow the user to control the view of the toggle component. Break the toggle component up into multiple composable components that can be rearranged b
阅读全文
摘要:create-react-app version 2.0 added a lot of new features. One of the new features is added the svgr webpack loader to wrap SVGs in React components as
阅读全文
摘要:To update the dependencies in the project, we can run:
阅读全文