02 2017 档案
摘要:Sometimes you just need a subset of an object. In this lesson, we'll cover how you can accomplish this using Ramda's pick and omit functions, as well
阅读全文
摘要:In this lesson, we'll grab arrays of values from other arrays, resulting in a nested array. From there, we'll look at multiple ways to flatten the arr
阅读全文
摘要:In this lesson we'll look at how you can use Ramda's unfold function to generate a list of values based on an initial seed. const R = require('ramda')
阅读全文
摘要:In Flow, you can make global declarion about types. Run: It will generate .flowconfig file, open it and add few lines of configration. So it says that
阅读全文
摘要:Install: For example you have installed lodash libaray, and you want the defination file also, you can do: It will help to install the files automatic
阅读全文
摘要:The talk from here. 1. The lifecycle in Angular component: constructor vs ngOnInit: Constructor: only used for injection. ngOnInit: for data initlizat
阅读全文
摘要:From: To: Example2:
阅读全文
摘要:Learn how to set an elements background image to embedded SVG. This method has an added benefit of not incurring any HTTP requests, as the SVG is simp
阅读全文
摘要:Learn how to set an SVG as the background image of an element. Background images can be resized by changing the width and height of the element contai
阅读全文
摘要:Just like a bitmap image, you can compress an SVG by removing various pieces of code that aren’t necessary to it rendering properly. This reduces file
阅读全文
摘要:To create a component dynamicly. 1. Add a container with ref: 2. View this container as ViewContainerRef. 3. We need ComponentFactoryResolver: 4. We w
阅读全文
摘要:ElementRef: ElementRef is a way to access native html element, notice that it only works for Broswer. Render: Render helps to take care of different p
阅读全文
摘要:Something important to consider when coding a web application is managing the user's focus. For keyboard and screen reader users, we must ensure their
阅读全文
摘要:TypeScript tries to infer as much about your code as it can. But sometimes there really is not enough context for it to infer reliably. If it tried to
阅读全文
摘要:We can use 'displayName' on component to change its component tag in dev tool: In dev tool:
阅读全文
摘要:Root Smart component can be overloaded, divide 'smart' component wisely & using Provider. Problem: Something the root component can be overloaded, mea
阅读全文
摘要:You can make any element keyboard interactive with the HTML tabindex attribute. But you might need a little extra JavaScript and ARIA to support keybo
阅读全文
摘要:We can use @ViewChild with component: By doing this, we actually can access component's prop and events. If we want to get component DOM node, what we
阅读全文
摘要:When you use @ViewChildren, the value can only be accessable inside ngAfterViewInit lifecycle. This is somehow different from @ViewChild, which value
阅读全文
摘要:For example we have a component: For TodoAppComponent, we make 'TodoList' as 'viewProviders'. And inside TodoAppComponent, we have TodoInputComponent
阅读全文
摘要:Content is what is passed as children. View is the template of the current component. The view is initialized before the content and ngAfterViewInit()
阅读全文
摘要:*The children element which are located inside of its template of a component are called *view children *. On the other hand, **elements which are use
阅读全文
摘要:We have looked at @ContentChild in article(http://www.cnblogs.com/Answer1215/p/6414657.html). Now let's how to query multi children by using @ContentC
阅读全文
摘要:@ContentChild normally works with ngAfterContentInit lifecycle. @ContentChild is used for looking into child component's props. For example, we a app
阅读全文
摘要:For example there is tow form compoennts on the page, and what we want to do is reusing the form component. Make to tow form behave differently, we ca
阅读全文
摘要: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
阅读全文
摘要:Handling your logic with composable functions makes your code declarative, leading to code that's easy to read and easy to test. Breaking that up to w
阅读全文
摘要:Learn to install JavaScript modules that include native code. Some React Native modules include native code for Android and/or iOS in addition to Java
阅读全文
摘要:In this lesson we'll take some existing code and refactor it using some functions from the Ramda library, most notably, compose and converge. When we'
阅读全文
摘要:Learn to write components that render differently on iOS and Android, but present the same API. First, we'll use the Platform module to change behavio
阅读全文
摘要:In redux, the action type is just a normal string type, it is easy to get naming conflicts in large application. Can use namespace-constants lib to so
阅读全文
摘要:We’ll discuss the display values pertinent to CSS Grid Layout – grid, inline-grid, and subgrid. Then, let’s jump in at the deep end by putting togethe
阅读全文
摘要:React loves svg just as much as it loves html. In this lesson we cover how simple it is to make SVG components in ReactJS. Creating SVG components wit
阅读全文
摘要:The default core theme comes preinstalled and ready to go with every new project. Learn how to use some of the many helpful utility classes that are p
阅读全文
摘要:Install: Create: Run: List all emulators: Run a different emulator: Livesync: Run with emulator: If you omit device 'ios', it will run both Android an
阅读全文
摘要:In this lesson we will look at pulling out complex npm script logic into an external JavaScript file. Instead of writing bash scripts you can leverage
阅读全文
摘要:In this lesson we will look at pulling out complex npm scripts into their own external bash scripts. This ends up simplifying your package.json file a
阅读全文
摘要:A technique you might use once you start having lots of npm scripts is to use a node package that allows you to define your scripts in an external pac
阅读全文
摘要:When doing comparisons inside of functions, you end of relying heavily on the argument passed into the function. Ramda's converge allows you to do com
阅读全文
摘要:Function Type: Interface:
阅读全文
摘要:The need for comments in your package.json file becomes desirable the more and more npm scripts you start to define. At first glance this might seem l
阅读全文
摘要:In this lesson we will look at different ways you can list the available npm scripts. Whether we want to pipe npm run through less or install an npm p
阅读全文
摘要:Unfortunately not all shell commands work across various environments. Two main techniques to support cross-environment scripts is to either use cross
阅读全文
摘要:You can really unlock the power of ramda (and functional programming in general) when you combine functions. Counting words in a string may seem like
阅读全文
摘要:In this lesson we will look about how we can integrate with git hooks to help enforce a certain level of quality before you either commit your code or
阅读全文
摘要:In addition to package.json level variables (such as name and version), you can have custom conf settings that can be used in your npm scripts. These
阅读全文
摘要:Often when testing, you use the actual result to create your assertion and have to manually update it as you make changes to the feature. With Jest sn
阅读全文
摘要:In this lesson we will show that you can leverage values that you already have provided in your package.json file such as the name and version keys. Y
阅读全文
摘要:In this lesson we will look at how we can setup our npm scripts to execute when the file system has changed. Some common examples of this are automati
阅读全文
摘要:We can utilize React.cloneElement in order to create new components with extended data or functionality. We render {items} below h2 tag, and for each
阅读全文
摘要:When you are using React components you need to be able to access specific references to individual component instances. This is done by defining a re
阅读全文
摘要:Event handlers are passed an instance of SyntheticEvent in React. In this video we'll take a look at the wide range of events available to us, includi
阅读全文
摘要:In an effort to bypass saving temporary build files you can leverage piping and output redirection to streamline your build process. In addition using
阅读全文
摘要:Often times you’ll have variations that you’ll want to make to your npm scripts and repeating yourself is inefficient and verbose. Instead you can cre
阅读全文
摘要:How do we set up a simple app with its own routes with their own components in Vue? Install: Define routers: Navgiation:
阅读全文
摘要:In this lesson, I introduce a memory leak into our node.js application and show you how to identify it using the Formidable nodejs-dashboard. Once ide
阅读全文
摘要: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
阅读全文
摘要:
阅读全文
摘要:From: To: So we create a index.ts file inside 'store' folder:
阅读全文
摘要:In this lesson we will run a set of scripts that are grouped together with a wildcard using the npm-run-all node package. Using this technique can hel
阅读全文
摘要:Running multiple scripts in series or in parallel can become very verbose. Using a tool such as npm-run-all can help reduce the amount of overhead you
阅读全文
摘要:In this lesson we will look at running several npm scripts in parallel. Sometimes you don’t need scripts to be run in series and switching them to run
阅读全文
摘要:After creating several npm script it becomes useful to run multiple scripts back-to-back in series. This is a nice feature because you can enforce tha
阅读全文
摘要:Using pushState and passing route data via context allows our application to respond to route changes made from Link components, but using the back an
阅读全文
摘要:We’ll create a Router component that will wrap our application and manage all URL related state. We’ll see how we can use React’s built in context mec
阅读全文
摘要: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)...
阅读全文
摘要:In this lesson we’ll see how to pass an item’s id value in an event handler and get the state to reflect our change. We’ll also create a helper functi
阅读全文
摘要:Example 1: A never stop while loop return a never type. Example 2: Never run If block You can use this to do exhaustive checks in union types. For exa
阅读全文