06 2016 档案

摘要:If you’re only instrumenting the files in your project that are under test then your code coverage report will be misleading and it will be difficult 阅读全文
posted @ 2016-06-29 01:06 Zhentiw 阅读(198) 评论(0) 推荐(0) 编辑
摘要:How much of your code runs during unit testing is an extremely valuable metric to track. Utilizing code the karma-coverage plugin and babel-plugin-__c 阅读全文
posted @ 2016-06-29 00:55 Zhentiw 阅读(247) 评论(0) 推荐(0) 编辑
摘要:When writing tests run by Karma for an application that’s bundled with webpack, it’s easiest to integrate webpack and Karma directly together. In this 阅读全文
posted @ 2016-06-28 01:48 Zhentiw 阅读(611) 评论(0) 推荐(0) 编辑
摘要:When you have a dependency that has dependencies on global variables (like jQuery or lodash) or assumes that this is bound to window, you can use the  阅读全文
posted @ 2016-06-28 01:33 Zhentiw 阅读(167) 评论(0) 推荐(0) 编辑
摘要:Let's try creating a deeper tree structure. This time we have 4 separate arrays each containing lists, videos, boxarts, and bookmarks respectively. Ea 阅读全文
posted @ 2016-06-27 21:54 Zhentiw 阅读(309) 评论(0) 推荐(0) 编辑
摘要:1. Use a for loop to traverse the videos and bookmarks array at the same time. For each video and bookmark pair, create a {videoId, bookmarkId} pair a 阅读全文
posted @ 2016-06-27 16:31 Zhentiw 阅读(212) 评论(0) 推荐(0) 编辑
摘要:Three ways to make object immutable: 1. Use JSON.parse(JSON.stringify(obj)): this approach is little bit expense. 2. Use Object.create() This is a che 阅读全文
posted @ 2016-06-27 16:06 Zhentiw 阅读(294) 评论(0) 推荐(0) 编辑
摘要:concatAll: Exercise 12: Retrieve id, title, and a 150x200 box art url for every video You've managed to flatten a tree that's two levels deep, let's t 阅读全文
posted @ 2016-06-26 22:46 Zhentiw 阅读(397) 评论(0) 推荐(0) 编辑
摘要:fetch() does the same thing as XHR, but fetch return a promise. Check the reponse API here: Link Besides text(), you can use json() or blob(). 'no-cor 阅读全文
posted @ 2016-06-25 21:06 Zhentiw 阅读(362) 评论(0) 推荐(0) 编辑
摘要:You can fine tune several webpack plugins to make your bundle as small as it can be for your specific application. However there are a few things you 阅读全文
posted @ 2016-06-25 01:51 Zhentiw 阅读(267) 评论(0) 推荐(0) 编辑
摘要:When you have a dependency that does not export itself properly, you can use the exports-loader to force it to export the pieces of the file that you 阅读全文
posted @ 2016-06-25 01:22 Zhentiw 阅读(257) 评论(0) 推荐(0) 编辑
摘要:When you use ngrx/store and you want to fire a service request. When it sucessfully return the response, you need to dispatch action to tell the store 阅读全文
posted @ 2016-06-24 03:02 Zhentiw 阅读(260) 评论(0) 推荐(0) 编辑
摘要:If you have a multi-page application (as opposed to a single page app), you’re likely sharing modules between these pages. By chunking these common mo 阅读全文
posted @ 2016-06-23 01:59 Zhentiw 阅读(245) 评论(0) 推荐(0) 编辑
摘要:Often, you have dependencies which you rarely change. In these cases, you can leverage the CommonsChunkPlugin to automatically put these modules in a 阅读全文
posted @ 2016-06-23 01:12 Zhentiw 阅读(286) 评论(0) 推荐(0) 编辑
摘要:Leveraging the browser cache is an important part of page load performance. A great way to utilize this cache is by versioning your resources. In this 阅读全文
posted @ 2016-06-22 21:45 Zhentiw 阅读(230) 评论(0) 推荐(0) 编辑
摘要:As a Single Page Application grows in size, the size of the payload can become a real problem for performance. In this lesson, learn how to leverage c 阅读全文
posted @ 2016-06-22 21:16 Zhentiw 阅读(186) 评论(0) 推荐(0) 编辑
摘要:If you're going to use code splitting with Webpack 2, you'll need to make sure the browser has support for the ES6 Promise API. This means that if you 阅读全文
posted @ 2016-06-22 20:50 Zhentiw 阅读(415) 评论(0) 推荐(0) 编辑
摘要:The less code you can send to the browser, the better. The concept of tree shaking basically says that if you’re not using some piece of code, then ex 阅读全文
posted @ 2016-06-22 04:15 Zhentiw 阅读(261) 评论(0) 推荐(0) 编辑
摘要:It’s quite common to make a mistake while developing your webpack configuration. A simple typo can cost you hours of development time. With webpack-va 阅读全文
posted @ 2016-06-22 03:51 Zhentiw 阅读(272) 评论(0) 推荐(0) 编辑
摘要:There are several lessons that will build on top of this project. It is a fairly standard, small webpack bundled project. In this lesson we’ll explore 阅读全文
posted @ 2016-06-19 02:06 Zhentiw 阅读(270) 评论(0) 推荐(0) 编辑
摘要:DOM hierarchy pseudo-classes allow you to style specific elements based on where they fall in the hierarchy and what type of elements they are. You ca 阅读全文
posted @ 2016-06-17 00:56 Zhentiw 阅读(261) 评论(0) 推荐(0) 编辑
摘要:It's common in Javascript for functions to accept different argument types and to also return different types. In this lesson we learn how to 'teach' 阅读全文
posted @ 2016-06-17 00:39 Zhentiw 阅读(244) 评论(0) 推荐(0) 编辑
摘要:slice filter map ...spread concat Object.assign 阅读全文
posted @ 2016-06-16 04:35 Zhentiw 阅读(175) 评论(0) 推荐(0) 编辑
摘要:delete keyword doesn't actually delete the value but just the reference. So here, what actually delete is the point of me.name: So the point from 'anm 阅读全文
posted @ 2016-06-14 20:17 Zhentiw 阅读(179) 评论(0) 推荐(0) 编辑
摘要:In this lesson, you will learn the difference between the exports statement and module.exports. Two examples are demonstrated, each accomplishing the 阅读全文
posted @ 2016-06-14 03:43 Zhentiw 阅读(159) 评论(0) 推荐(0) 编辑
摘要:First, what is 'High Order function', basic just a function, inside the function return another fuction. For example: Decorators is a subset of high o 阅读全文
posted @ 2016-06-14 03:10 Zhentiw 阅读(376) 评论(0) 推荐(0) 编辑
摘要:TypeScript allows you to generate definition files for your own libraries. This lesson shows you how to organize your project and generate the definit 阅读全文
posted @ 2016-06-14 02:06 Zhentiw 阅读(265) 评论(0) 推荐(0) 编辑
摘要:When multiple decorators apply to a single declaration, their evaluation is similar to function composition in mathematics. In this model, when compos 阅读全文
posted @ 2016-06-13 21:24 Zhentiw 阅读(193) 评论(0) 推荐(0) 编辑
摘要:new.target is a new “magical” value available in all functions, thoughin normal functions it will always be undefined. In any constructor,new.target a 阅读全文
posted @ 2016-06-13 20:50 Zhentiw 阅读(118) 评论(0) 推荐(0) 编辑
摘要:Each function should have a 'name' property. It can be anonymous, empty, the same as function name, or class name. For example: 阅读全文
posted @ 2016-06-13 17:24 Zhentiw 阅读(132) 评论(0) 推荐(0) 编辑
摘要:Original artial --> link How descorator looks like: Descorator in action: We have a class, which have an method call meow(): When Javascritp Engine re 阅读全文
posted @ 2016-06-13 04:32 Zhentiw 阅读(362) 评论(0) 推荐(0) 编辑
摘要:Orgial aritial --> Link The problem with Angular 1 DI: Angular 2 DI: Solve the singletons problem: The service you inject to the parent component can 阅读全文
posted @ 2016-06-12 03:45 Zhentiw 阅读(243) 评论(0) 推荐(0) 编辑
摘要:Oingial aritial --> Link Take away: When you use `templateUrl` & `styleUrls`, the path are relative to the application root. So if you compoennt is pu 阅读全文
posted @ 2016-06-11 22:32 Zhentiw 阅读(305) 评论(0) 推荐(0) 编辑
摘要:TypeScript allows you to emit decorator metadata which enables more powerful features through reflection. This lesson show you how decorators and refl 阅读全文
posted @ 2016-06-11 05:07 Zhentiw 阅读(1045) 评论(0) 推荐(0) 编辑
摘要:Decorators are a feature of TypeScript that are becoming more and more common in many major libraries. This lesson walks you through what decorators a 阅读全文
posted @ 2016-06-10 17:39 Zhentiw 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Using TypeScript when installing packages from npm often requires you to install related definition files. This lesson shows you how to use typings to 阅读全文
posted @ 2016-06-10 03:22 Zhentiw 阅读(283) 评论(0) 推荐(0) 编辑
摘要:One of the most confusing parts of getting started with TypeScript is figuring out how to use all the libraries that you know and love from JavaScript 阅读全文
posted @ 2016-06-10 02:14 Zhentiw 阅读(2279) 评论(0) 推荐(0) 编辑
摘要:This lesson covers using your first TypeScript Interface and what happens to the Interface when it is compiled down to JavaScript. Define the interfac 阅读全文
posted @ 2016-06-10 01:59 Zhentiw 阅读(114) 评论(0) 推荐(0) 编辑
摘要:Beyond classes and IDs CSS also provides selectors to target element based on their attributes. In this lesson we'll look at selecting elements based 阅读全文
posted @ 2016-06-09 04:51 Zhentiw 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Files globs will be available in TypeScript 2.0, so in the meantime, we need to use "exclude" and "rootDir" to configure which files to load. This les 阅读全文
posted @ 2016-06-09 04:39 Zhentiw 阅读(265) 评论(0) 推荐(0) 编辑
摘要:TypeScript will always compile even if there are ridiculous errors in your project. This lesson shows how to configure your .tsconfig with "noEmitOnEr 阅读全文
posted @ 2016-06-09 04:17 Zhentiw 阅读(178) 评论(0) 推荐(0) 编辑
摘要:This lesson shows how to configure the .tsconfig so you only compile the .ts files you want. It then shows how to configure which directory you'd like 阅读全文
posted @ 2016-06-09 02:25 Zhentiw 阅读(381) 评论(0) 推荐(0) 编辑
摘要:This lesson walks you through creating your first .tsconfig configuration file which will tell the TypeScript compiler how to treat your .ts files. In 阅读全文
posted @ 2016-06-09 02:06 Zhentiw 阅读(305) 评论(0) 推荐(0) 编辑
摘要:This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file from the command line. install: app.ts: RUN: You wi 阅读全文
posted @ 2016-06-09 01:47 Zhentiw 阅读(257) 评论(0) 推荐(0) 编辑
摘要:We will learn how to fire up an async request when the route changes. A mock server data: We want to replace localStorge with mock server data, so rem 阅读全文
posted @ 2016-06-08 03:27 Zhentiw 阅读(429) 评论(0) 推荐(0) 编辑
摘要:We will learn how centralized updates in Redux let us log every state change to the console along with the action that caused it. 阅读全文
posted @ 2016-06-07 04:25 Zhentiw 阅读(264) 评论(0) 推荐(0) 编辑
摘要:We will learn how to normalize the state shape to ensure data consistency that is important in real-world applications. We currently represent the tod 阅读全文
posted @ 2016-06-07 04:15 Zhentiw 阅读(297) 评论(0) 推荐(0) 编辑
摘要:We will learn how to encapsulate the knowledge about the state shape in the reducer files, so that the components don’t have to rely on it. In current 阅读全文
posted @ 2016-06-06 21:08 Zhentiw 阅读(218) 评论(0) 推荐(0) 编辑
摘要:We will learn how to avoid the boilerplate code in mapDispatchToProps() for the common case where action creator arguments match the callback prop arg 阅读全文
posted @ 2016-06-06 03:21 Zhentiw 阅读(503) 评论(0) 推荐(0) 编辑
摘要:We will learn how to use withRouter() to inject params provided by React Router into connected components deep in the tree without passing them down a 阅读全文
posted @ 2016-06-06 03:11 Zhentiw 阅读(1076) 评论(1) 推荐(1) 编辑
摘要:We will learn how adding React Router shifts the balance of responsibilities, and how the components can use both at the same time. Now when we click 阅读全文
posted @ 2016-06-06 02:50 Zhentiw 阅读(449) 评论(0) 推荐(0) 编辑
摘要:Single, race both get only one emit value from the stream. Single(fn): race(...observable): Observable 阅读全文
posted @ 2016-06-05 22:29 Zhentiw 阅读(319) 评论(0) 推荐(0) 编辑
摘要:Link : Video. 1. Firebase Auth: provides simple login with Github, Google, Facebook, Twittr. Link 2. Manifest: 3. Generate Mainfest and icons: Link 4. 阅读全文
posted @ 2016-06-05 21:43 Zhentiw 阅读(611) 评论(0) 推荐(0) 编辑
摘要:We will learn how to change the address bar using a component from React Router. In Root.js: We need to add a param to change the Route: (:filter) mea 阅读全文
posted @ 2016-06-04 16:03 Zhentiw 阅读(312) 评论(0) 推荐(0) 编辑
摘要:We will learn how to add React Router to a Redux project and make it render our root component. Install: Router should be wrapped inside Provider, the 阅读全文
posted @ 2016-06-04 15:35 Zhentiw 阅读(275) 评论(0) 推荐(0) 编辑
摘要:We will learn how to better separate the code in the entry point to prepare it for adding the router. Currently, in the index.js, we configure the sto 阅读全文
posted @ 2016-06-04 04:12 Zhentiw 阅读(283) 评论(0) 推荐(0) 编辑
摘要:We will learn how to use store.subscribe() to efficiently persist some of the app’s state to localStorage and restore it after a refresh. To save data 阅读全文
posted @ 2016-06-04 03:43 Zhentiw 阅读(404) 评论(0) 推荐(0) 编辑
摘要:We will learn how to start a Redux app with a previously persisted state, and how it merges with the initial state specified by the reducers. The init 阅读全文
posted @ 2016-06-03 02:22 Zhentiw 阅读(252) 评论(0) 推荐(0) 编辑
摘要:Mainly introduce two libaraies: sw-precache and sw-toolbox. Install: Types of caching Broadly, there are two types of caching Precaching—We'll precach 阅读全文
posted @ 2016-06-02 03:33 Zhentiw 阅读(365) 评论(0) 推荐(0) 编辑
摘要:Libraries such as RxJS use generics heavily in their definition files to describe how types flow through different interfaces and function calls. We c 阅读全文
posted @ 2016-06-01 18:14 Zhentiw 阅读(564) 评论(0) 推荐(0) 编辑
摘要:Applications are driven by state. Many things, like the user interface, should always be consistent with that state.MobX is a general purpose FRP libr 阅读全文
posted @ 2016-06-01 05:03 Zhentiw 阅读(331) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示