摘要:In this post, we are going to see how to use Ramda Lens. For example, we have data: R.lens: R.lens takes a getter and a setter: R.lensProp: There is a 阅读全文
posted @ 2019-02-24 20:12 Zhentiw 阅读 (274) 评论 (0)
摘要:Just like the State ADT an Array is also an Applicative Functor. That means we can do the same tricks with liftA2 with Array that we have been doing w 阅读全文
posted @ 2019-01-16 16:30 Zhentiw 阅读 (141) 评论 (0)
摘要:Use custom Cypress command for reusable assertions We’re duplicating quite a few commands between the registration and login of our user for assertion 阅读全文
posted @ 2018-12-06 21:13 Zhentiw 阅读 (122) 评论 (0)
摘要:Use Cypress to test user registration Let’s write a test to fill out our registration form. Because we’ll be running this against a live backend, we n 阅读全文
posted @ 2018-12-05 15:54 Zhentiw 阅读 (99) 评论 (0)
摘要:Despite the fact that Cypress is an application that runs natively on your machine, you can install it and add it as a dependency just like all other 阅读全文
posted @ 2018-12-05 02:38 Zhentiw 阅读 (189) 评论 (0)
摘要:1. Color Picker (Chrome) You might know how to use color picker in Chrome, recently there is a feature inside color picker which is "Contrast Ratio", 阅读全文
posted @ 2018-07-15 18:41 Zhentiw 阅读 (93) 评论 (0)
摘要:We'll examine how to unnest function calls, capture assignment, and create a linear data flow with a type we call Box. This is our introduction to wor 阅读全文
posted @ 2016-12-11 21:47 Zhentiw 阅读 (110) 评论 (0)
摘要:Well, this stuff will be a little bit strange if you deal with it first time. Container Object: Just a wrapper / contianer for values No Method No Nou 阅读全文
posted @ 2016-09-06 04:23 Zhentiw 阅读 (132) 评论 (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 阅读 (128) 评论 (0)
摘要:Somehow it looks like reflect in Java. For example: We define an mothod on the Object, it called defineMethod(). It accepts two arguements, one is met 阅读全文
posted @ 2016-05-02 03:06 Zhentiw 阅读 (225) 评论 (0)
摘要:Install Karam: npm install -g karma npm install -g karma-cli Init Karam: karma init First test: 1. Add test file to the karma.conf.js: // list of file 阅读全文
posted @ 2016-03-06 18:14 Zhentiw 阅读 (325) 评论 (0)
摘要:The very first thing to understand when we're talking about this-keyword is really understand what's the purpose of the this-keyword is, or why we eve 阅读全文
posted @ 2015-08-20 02:15 Zhentiw 阅读 (211) 评论 (0)
摘要:Set up server for JWT Authentication 1. require express 2. require faker: If faker is not install yet, do: npm install express faker // faker is what 阅读全文
posted @ 2014-10-15 22:32 Zhentiw 阅读 (943) 评论 (0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-09-09 21:24 Zhentiw 阅读 (33) 评论 (0)
正文内容加载中...
posted @ 2020-03-15 02:57 Zhentiw 阅读 (3) 评论 (0)
摘要:const Reader = run => ({ run, map: f => Reader(x => f(run(x))), chain: f => Reader(x => f(run(x)).run(x)), concat(o) { return Reader(x => run(x).conca 阅读全文
posted @ 2020-03-14 05:07 Zhentiw 阅读 (4) 评论 (0)
摘要:Let's say we have App.component.ts, it use provider inside component level: @Component({ selector: 'app-root', templateUrl: './app.component.html', st 阅读全文
posted @ 2020-03-14 04:37 Zhentiw 阅读 (3) 评论 (0)
摘要:Rules Each page should have at least one <h1> Pages should be structured in a hierarchical manner <h1>: being the most important (usually page titles 阅读全文
posted @ 2020-03-13 16:28 Zhentiw 阅读 (5) 评论 (0)
摘要:Reader Monad Continue with previous post, here we have some helper functions: const toUpper = s => s.toUpperCase(); const exclaim = s => `${s}!`; And 阅读全文
posted @ 2020-03-13 04:10 Zhentiw 阅读 (7) 评论 (0)
摘要:Let's say we have two fucntions: const toUpper = s => s.toUpperCase(); const exclaim = s => `${s}!`; We want to combine those. But function itself doe 阅读全文
posted @ 2020-03-13 03:39 Zhentiw 阅读 (5) 评论 (0)
摘要:useState is typically simpler at first than useReducer (you can even implement useState using useReducer), but there's one scenario where useReducer i 阅读全文
posted @ 2020-03-11 17:56 Zhentiw 阅读 (10) 评论 (0)
摘要:Learn how to use custom events to expose internal events from withing a web component. class MyWelcome extends HTMLElement { constructor() { super(); 阅读全文
posted @ 2020-03-11 16:31 Zhentiw 阅读 (6) 评论 (0)
摘要:We want to write a Monoid, which able to take function called 'run', therefore we able to run a serial of functions together to get a combined result. 阅读全文
posted @ 2020-03-10 18:09 Zhentiw 阅读 (6) 评论 (0)
摘要:const [state, dispatch] = useReducer(reducer, initialArg, init); The third arguement 'init' is a lazy initialization which is a function. It is useful 阅读全文
posted @ 2020-03-10 16:35 Zhentiw 阅读 (7) 评论 (0)