05 2018 档案

摘要:When we use NGRX, we need to create some bolipates. Now with Angulalr6, we can use CLI to generate those code for us. Install: @ngrx/schematics: Scaff 阅读全文
posted @ 2018-05-28 01:52 Zhentiw 阅读(360) 评论(0) 推荐(0) 编辑
摘要:In this lesson I show how to use webpack to code split based on route in VueJS. Code splitting is a useful tool to help eliminate unused code and only 阅读全文
posted @ 2018-05-26 23:09 Zhentiw 阅读(480) 评论(0) 推荐(0) 编辑
摘要:Testing your application’s behavior when an XHR call results in an error can be difficult. The use of stubs for XHR calls makes it easy for us to setu 阅读全文
posted @ 2018-05-26 22:45 Zhentiw 阅读(315) 评论(0) 推荐(0) 编辑
摘要:In this lesson well stub a POST request and use Cypress commands to fill in and submit a form. We’ll wait for the submission to resolve and then asser 阅读全文
posted @ 2018-05-26 22:33 Zhentiw 阅读(484) 评论(0) 推荐(0) 编辑
摘要:Cypress provides a straightforward API that allows you to define custom commands. In this lesson, we’ll take a series of Cypress commands and wrap the 阅读全文
posted @ 2018-05-25 21:29 Zhentiw 阅读(455) 评论(0) 推荐(0) 编辑
摘要:When testing interactions that require asynchronous calls, we’ll need to wait on responses to make sure we’re asserting about the application state at 阅读全文
posted @ 2018-05-25 21:19 Zhentiw 阅读(433) 评论(0) 推荐(0) 编辑
摘要:When creating integration tests with Cypress, we’ll often want to stub network requests that respond with large datasets. All of this mock data can le 阅读全文
posted @ 2018-05-25 21:13 Zhentiw 阅读(472) 评论(0) 推荐(0) 编辑
摘要:To keep our tests fast and easily repeatable, it makes sense to create many integration tests and fewer full end-to-end tests. In this lesson, we’ll s 阅读全文
posted @ 2018-05-25 20:59 Zhentiw 阅读(204) 评论(0) 推荐(0) 编辑
摘要:React based applications often use controlled inputs, meaning the input event leads to the application code setting the value of the very input we’re 阅读全文
posted @ 2018-05-24 21:23 Zhentiw 阅读(259) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we’ll add tests that finds a focused input. We’ll use Chrome’s dev tools from inside the Cypress runner to inspect the element and upd 阅读全文
posted @ 2018-05-24 21:10 Zhentiw 阅读(278) 评论(0) 推荐(0) 编辑
摘要:Adding Cypress to a project is a simple npm install away. We won’t need any global dependencies beyond node and npm to get started with Cypress. In th 阅读全文
posted @ 2018-05-24 20:51 Zhentiw 阅读(241) 评论(0) 推荐(0) 编辑
摘要:Latest Javascript features, not supported by all broswers, but can use with babel. # try-catch-finally, Promise finally: # Regex: 1. Lookbehind: 2. Lo 阅读全文
posted @ 2018-05-21 20:44 Zhentiw 阅读(239) 评论(0) 推荐(0) 编辑
摘要:When the element has empty content, you might want to display some text to idicate the compoent is loading... 阅读全文
posted @ 2018-05-21 16:15 Zhentiw 阅读(145) 评论(0) 推荐(0) 编辑
摘要:In this lesson, you will learn how to statically type variables in Python 3.6 Static typing can help you avoid errors when consumers of your variables 阅读全文
posted @ 2018-05-21 02:15 Zhentiw 阅读(249) 评论(0) 推荐(0) 编辑
摘要:Values assigned with let and const are seen everywhere in JavaScript. It's become common to hear them explained like so: "const creates an constant (i 阅读全文
posted @ 2018-05-21 02:11 Zhentiw 阅读(132) 评论(0) 推荐(0) 编辑
摘要:function solution( tags = ['ul', 'ol']) { const [uls, ols] = tags.map(tag => Array.from($(`${tag}`))); const [logUl, logOl] = tags.map(tag => new Logg 阅读全文
posted @ 2018-05-17 05:02 Zhentiw 阅读(256) 评论(0) 推荐(0) 编辑
摘要:JavaScript provides primitive types and means of processing those. However, those are not enough. Real data must somehow come into the program and dat 阅读全文
posted @ 2018-05-15 21:59 Zhentiw 阅读(270) 评论(0) 推荐(0) 编辑
摘要:Functions are first class in JavaScript. This means we can treat a function like any other data. This also means we can end up with a function as the 阅读全文
posted @ 2018-05-14 21:02 Zhentiw 阅读(239) 评论(0) 推荐(0) 编辑
摘要:The alt method allows us to recover from a nothing with a default Maybe, but sometimes our recovery efforts might need to enlist some logic to recover 阅读全文
posted @ 2018-05-14 18:54 Zhentiw 阅读(364) 评论(0) 推荐(0) 编辑
摘要:Once we’re using Maybes throughout our code, it stands to reason that at some point we’ll get a Maybe and want to continue applying transformations. W 阅读全文
posted @ 2018-05-14 17:54 Zhentiw 阅读(377) 评论(0) 推荐(0) 编辑
摘要:In this lesson I refactor some code that utilizes the Mutation component to update client-side cache to use the new ApolloConsumer component baked int 阅读全文
posted @ 2018-05-13 01:46 Zhentiw 阅读(386) 评论(0) 推荐(0) 编辑
摘要:Sometimes, we run into situations where we end up with a Maybe within the context of another Maybe. Nested structures like this can get really confusi 阅读全文
posted @ 2018-05-11 20:36 Zhentiw 阅读(516) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we’ll look at the propPath utility function. We’ll ask for a property multiple levels deep in an object and get back a Maybe. We’ll ge 阅读全文
posted @ 2018-05-11 20:18 Zhentiw 阅读(207) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we’ll use a Maybe to safely operate on properties of an object that could be undefined. We’ll use our initial code as the basis for a  阅读全文
posted @ 2018-05-11 19:34 Zhentiw 阅读(218) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we’ll create a safe function that gives us a flexible way to create Maybes based on a value and a predicate function that we supply. W 阅读全文
posted @ 2018-05-11 19:04 Zhentiw 阅读(196) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we’ll get started with the Maybe type. We’ll look at the underlying Just and Nothing types and create a simple utility function to cre 阅读全文
posted @ 2018-05-11 03:15 Zhentiw 阅读(201) 评论(0) 推荐(0) 编辑
摘要:When it comes to websites performance is king. How long it takes for a page to load can mean the difference of millions of dollars for large ecommerce 阅读全文
posted @ 2018-05-08 20:27 Zhentiw 阅读(319) 评论(0) 推荐(0) 编辑
摘要:getSnapshotBeforeUpdate is a lifecycle hook that was introduced with React 16.3. It is invoked right before the most recently rendered output is commi 阅读全文
posted @ 2018-05-08 19:24 Zhentiw 阅读(258) 评论(0) 推荐(0) 编辑
摘要:getDerivedStateFromProps is lifecycle hook introduced with React 16.3 and intended as a replacement for componentWillReceiveProps. It is invoked after 阅读全文
posted @ 2018-05-08 19:19 Zhentiw 阅读(597) 评论(0) 推荐(0) 编辑
摘要:The function forwardRef allows us to extract a ref and pass it to its descendants. This is a powerful tool, but should be used with caution to avoid u 阅读全文
posted @ 2018-05-07 16:42 Zhentiw 阅读(557) 评论(0) 推荐(0) 编辑
摘要:Prevent Partail Page display: By using Resolver: Display Loading spinner when switching page: Enable route debugging: Talk 阅读全文
posted @ 2018-05-07 03:08 Zhentiw 阅读(201) 评论(0) 推荐(0) 编辑
摘要:By default, React Native only targets iPhone - so if you run on an iPad, it will show up as a scaled app, and won't look like a native iPad app. To ta 阅读全文
posted @ 2018-05-03 20:44 Zhentiw 阅读(317) 评论(0) 推荐(0) 编辑
摘要:For example you make a function to get rating; Then using it in html: These code actually casues the preformance issues, because everything Angualr's 阅读全文
posted @ 2018-05-03 20:40 Zhentiw 阅读(201) 评论(0) 推荐(0) 编辑
摘要:1. Installl latest @angular/cli: The version I used is:6.0.0-rc.10 2. Create a new application: 3. Install material and cdk packages: Here need to add 阅读全文
posted @ 2018-05-03 19:43 Zhentiw 阅读(420) 评论(0) 推荐(0) 编辑
摘要:The componentWillReceiveProps() method is being deprecated in future version of React (17). Many of us use this method day-to-day to check for incomin 阅读全文
posted @ 2018-05-02 18:51 Zhentiw 阅读(744) 评论(0) 推荐(0) 编辑

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