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 阅读全文
posted @ 2017-02-28 21:29 Zhentiw 阅读(455) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-28 20:13 Zhentiw 阅读(412) 评论(0) 推荐(0) 编辑
摘要: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') 阅读全文
posted @ 2017-02-28 17:18 Zhentiw 阅读(280) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-28 16:19 Zhentiw 阅读(351) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-27 21:49 Zhentiw 阅读(178) 评论(0) 推荐(0) 编辑
摘要:The talk from here. 1. The lifecycle in Angular component: constructor vs ngOnInit: Constructor: only used for injection. ngOnInit: for data initlizat 阅读全文
posted @ 2017-02-27 02:59 Zhentiw 阅读(323) 评论(0) 推荐(0) 编辑
摘要:From: To: Example2: 阅读全文
posted @ 2017-02-27 00:32 Zhentiw 阅读(493) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-24 22:45 Zhentiw 阅读(187) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-24 22:39 Zhentiw 阅读(237) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-24 22:28 Zhentiw 阅读(259) 评论(0) 推荐(0) 编辑
摘要:To create a component dynamicly. 1. Add a container with ref: 2. View this container as ViewContainerRef. 3. We need ComponentFactoryResolver: 4. We w 阅读全文
posted @ 2017-02-24 04:11 Zhentiw 阅读(702) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-24 03:40 Zhentiw 阅读(373) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-23 19:50 Zhentiw 阅读(183) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-23 04:20 Zhentiw 阅读(275) 评论(0) 推荐(0) 编辑
摘要:We can use 'displayName' on component to change its component tag in dev tool: In dev tool: 阅读全文
posted @ 2017-02-23 04:10 Zhentiw 阅读(507) 评论(0) 推荐(0) 编辑
摘要:Root Smart component can be overloaded, divide 'smart' component wisely & using Provider. Problem: Something the root component can be overloaded, mea 阅读全文
posted @ 2017-02-22 20:12 Zhentiw 阅读(347) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-21 01:29 Zhentiw 阅读(192) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-20 00:40 Zhentiw 阅读(377) 评论(0) 推荐(0) 编辑
摘要:When you use @ViewChildren, the value can only be accessable inside ngAfterViewInit lifecycle. This is somehow different from @ViewChild, which value 阅读全文
posted @ 2017-02-20 00:31 Zhentiw 阅读(1557) 评论(0) 推荐(0) 编辑
摘要:For example we have a component: For TodoAppComponent, we make 'TodoList' as 'viewProviders'. And inside TodoAppComponent, we have TodoInputComponent 阅读全文
posted @ 2017-02-20 00:19 Zhentiw 阅读(651) 评论(0) 推荐(0) 编辑
摘要:Content is what is passed as children. View is the template of the current component. The view is initialized before the content and ngAfterViewInit() 阅读全文
posted @ 2017-02-19 23:40 Zhentiw 阅读(2320) 评论(0) 推荐(0) 编辑
摘要:*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 阅读全文
posted @ 2017-02-19 23:31 Zhentiw 阅读(703) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-19 01:34 Zhentiw 阅读(1200) 评论(0) 推荐(0) 编辑
摘要:@ContentChild normally works with ngAfterContentInit lifecycle. @ContentChild is used for looking into child component's props. For example, we a app 阅读全文
posted @ 2017-02-19 01:12 Zhentiw 阅读(1263) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-19 00:48 Zhentiw 阅读(397) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-17 18:58 Zhentiw 阅读(215) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-17 18:50 Zhentiw 阅读(426) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-16 02:28 Zhentiw 阅读(244) 评论(0) 推荐(0) 编辑
摘要: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' 阅读全文
posted @ 2017-02-15 17:42 Zhentiw 阅读(340) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-15 02:15 Zhentiw 阅读(259) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-13 16:04 Zhentiw 阅读(350) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-13 15:33 Zhentiw 阅读(265) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-13 02:38 Zhentiw 阅读(289) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-13 00:36 Zhentiw 阅读(208) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-12 20:33 Zhentiw 阅读(275) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-12 02:38 Zhentiw 阅读(380) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-12 02:21 Zhentiw 阅读(241) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-12 02:05 Zhentiw 阅读(564) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-11 17:08 Zhentiw 阅读(287) 评论(0) 推荐(0) 编辑
摘要:Function Type: Interface: 阅读全文
posted @ 2017-02-10 03:26 Zhentiw 阅读(142) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-08 20:26 Zhentiw 阅读(161) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-08 20:18 Zhentiw 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Unfortunately not all shell commands work across various environments. Two main techniques to support cross-environment scripts is to either use cross 阅读全文
posted @ 2017-02-08 16:38 Zhentiw 阅读(478) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-08 16:10 Zhentiw 阅读(323) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-07 21:22 Zhentiw 阅读(350) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-07 21:13 Zhentiw 阅读(167) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-07 20:27 Zhentiw 阅读(315) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-07 18:52 Zhentiw 阅读(349) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-07 18:45 Zhentiw 阅读(221) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-06 20:32 Zhentiw 阅读(294) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-06 19:55 Zhentiw 阅读(271) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-06 19:46 Zhentiw 阅读(224) 评论(0) 推荐(0) 编辑
摘要:In an effort to bypass saving temporary build files you can leverage piping and output redirection to streamline your build process. In addition using 阅读全文
posted @ 2017-02-06 19:43 Zhentiw 阅读(228) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-06 19:36 Zhentiw 阅读(251) 评论(0) 推荐(0) 编辑
摘要:How do we set up a simple app with its own routes with their own components in Vue? Install: Define routers: Navgiation: 阅读全文
posted @ 2017-02-06 19:30 Zhentiw 阅读(219) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-06 19:25 Zhentiw 阅读(237) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-06 02:46 Zhentiw 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-02-06 00:02 Zhentiw 阅读(129) 评论(0) 推荐(0) 编辑
摘要:From: To: So we create a index.ts file inside 'store' folder: 阅读全文
posted @ 2017-02-05 23:57 Zhentiw 阅读(192) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-03 21:56 Zhentiw 阅读(222) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-03 21:48 Zhentiw 阅读(236) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-03 21:43 Zhentiw 阅读(263) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-03 21:37 Zhentiw 阅读(171) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-03 18:18 Zhentiw 阅读(494) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-03 16:46 Zhentiw 阅读(255) 评论(0) 推荐(0) 编辑
摘要: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)... 阅读全文
posted @ 2017-02-02 19:44 Zhentiw 阅读(240) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-02 17:04 Zhentiw 阅读(279) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-02-01 01:36 Zhentiw 阅读(224) 评论(0) 推荐(0) 编辑

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