摘要:
Creational patterns provide object creation mechanisms that increase flexibility and reuse of existing code. Factory method: Provides an interface for 阅读全文
摘要:
Just for fun... Given a number (always positive) as a type. Your type should return the number decreased by one. For example: type Zero = MinusOne<1> 阅读全文
摘要:
Blog: https://www.geeksforgeeks.org/es6-trampoline-function/ Stackoverflow problem for recursion: const sumBelow = (number, sum = 0) => ( number 0 ? s 阅读全文
摘要:
Serverless framework with AWS Link to each sections Table of Content: Part 0: Serverless Project structure Part 1: DynamoDB & ApiGateway Part 2: Event 阅读全文
摘要:
Storage Services: S3 Glacier CloudFront Elastic Block Store (EBS) Storage Gateway Snow family Database Overview Block storage: Used on local networks 阅读全文
摘要:
S3 Features Prefiees and delimiters For example: the file name in S3 can be: `marking/plans/kpi_2021_1.pdf`. The point is make it looks like a folder 阅读全文
摘要:
In our previous code, we have seen this partten for operators: // #region operators const concat = curry((broadcaster, listener) => { let string = ''; 阅读全文
该文被密码保护。 阅读全文
摘要:
Generators can yield promises which can work with the "for await of" loop syntax. This lesson shows how all the pieces fit together and explains why t 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Use custom Cypress command for reusable assertions We’re duplicating quite a few commands between the registration and login of our user for assertion 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Ensure Functions are Called Correctly with JavaScript Mocks Often when writing JavaScript tests and mocking dependencies, you’ll want to verify that t 阅读全文
摘要:
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", 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
vim cheat sheet Keep this handy as you experiment with vim: http://www.fprintf.net/vimCheatSheet.html Here is another guide that covers the commands i 阅读全文
摘要:
We start with three interface types: User, Organisation, and Product. These types share common properties: id, name, and imageId, but each also posses 阅读全文
摘要:
One common question is whether to use type or interface in TypeScript. To clarify the difference, type can represent anything, including objects, wher 阅读全文
摘要:
You don't really need to apply a really complex regex for one validation, instead you can combine multi regex together to fulfilll the task. const reg 阅读全文
摘要:
You cannot assign anything to never, except for never itself. // red squiggly lines under everything in parens fn("hello"); fn(42); fn(true); fn({}); 阅读全文
摘要:
https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_46.md#add-all-missing-imports-source-action 阅读全文
摘要:
declare const tag: unique symbol; export type EmptyObject = { [tag]?: never }; // Record<PropertyKey, never> const acceptOnlyEmptyObject = (input: Emp 阅读全文
摘要:
const acceptAnythingExceptNullOrUndefined = <T>(input: {}) => {}; acceptAnythingExceptNullOrUndefined('hello'); acceptAnythingExceptNullOrUndefined(42 阅读全文
摘要:
Any time when you have non-primitive type, it's going to be removed from memory anytime if it is no longer needed. class Test { constructor(name) { th 阅读全文
摘要:
Video: https://www.youtube.com/watch?v=PkFuytYVqI8&list=WL&index=67 body └─ article.feature ├─ section.article-hero │ ├─ h2 │ └─ img │ ├─ section.arti 阅读全文