随笔分类 - Javascript
摘要:Testing your sites on mobile devices is a critical part of the development process. Webpack dev server enables you to visit the server from any device
阅读全文
摘要:In this lesson, we will look at Greensock's Draggable API. We will implement a scrollable <div>container and explore some options available. DOC
阅读全文
摘要:Function composition allows us to build up powerful functions from smaller, more focused functions. In this lesson we'll demystify how function compos
阅读全文
摘要:forkJoin: When all observables complete emit the last value from each.
阅读全文
摘要:We often want to check if an array includes a specific item. It's been common to do this with the Array.prototype.indexOf method, but now we have a si
阅读全文
摘要:Dealing with the special NaN value can be tricky in JavaScript. It behaves like a number and not a number at the same time. This lesson explains how t
阅读全文
摘要:const _pipe = (f, g) => (...args) => g(f(...args)) export const pipe = (...fns) => fns.reduce(_pipe) import {partial, pipe} from './utils' const add = (a, b) => a + b const addThree = (a, b, c)...
阅读全文
摘要:The Chrome console allows you to format messages using CSS properties. This lesson walks you through the syntax of formatting your logs with css then
阅读全文
摘要:What is Isomorphisms?We have a value x, then apply function 'to' and 'from' to value 'x', the result we should still get 'x'. So Isomorphisms is kind
阅读全文
摘要:Most provides many means for creating streams, the simplest of which is the offunction. In this lesson, we demonstrate the use of of to lift a single
阅读全文
摘要:If you want to check whether a key is inside an Object or Array, you can use 'in': Object: Array:
阅读全文
摘要:By default, Travis will build all branches, tags, and Pull Requests. Because we're building our master branch before we release, we don't need Travis
阅读全文
摘要:We take our Promise.all() analogy further by using traversable on a Map(). Then we use two traversals in the same workflow. Traverse is good for maint
阅读全文
摘要:We find a couple of DOM nodes that may or may not exist and run a calculation on the page height using applicatives. For example we want to get the ma
阅读全文
摘要:We see what it means to curry a function, then walk through several examples of curried functions and their use cases. For example we have an 'add' fu
阅读全文
摘要:We examine the of function we've seen on a few types and discover it's the Pointed interface. Instead of doing constructor way of Task: We can just sa
阅读全文
摘要:We learn the formal definition of a functor and look at the laws they obey. Any Functor should follow two rules: 1. Function composition: Map twice eq
阅读全文
摘要:We refactor a standard node callback style workflow into a composed task-based workflow. For example we have the code as following: We want to wrap as
阅读全文
摘要:We examine the data structure Task, see some constructors, familiar methods, and finally how it captures side effects through laziness. We using a 'da
阅读全文
摘要:If change the data a litte bit: Because the view: null, then it will skip .map(sum).
阅读全文