摘要:
For example, we have a type repersent currency: USD, value should be something like '$123', a string type with `$` and number. So let's say we make a 阅读全文
摘要:
Currying is the technique of converting a function that takes multiple arguments into a sequence of functions that each take a single argument. But in 阅读全文
摘要:
jest.mock('./filename', () => { const originalModule = jest.requireActual('./filename') return { ...originalModule, fnA: jest.fn(), fnB: (b: boolean): 阅读全文
摘要:
This challenge continues from 476 - Sum, it is recommended that you finish that one first, and modify your code based on it to start this challenge. I 阅读全文
摘要:
Implement a type `Sum<A, B>` that summing two non-negative integers and returns the sum as a string. Numbers can be specified as a string, number, or 阅读全文
摘要:
// Doesn't work import React from 'react' import { saveInfo } from './api' export default function App() { const [count, setCount] = React.useState(0) 阅读全文
摘要:
https://bestofjs.org/projects/valtio Cool things about Valtio, it is completely independ from React component. It is self testable and hook with React 阅读全文
摘要:
Implement a type-level integers comparator. We've provided an enum for indicating the comparison result, like this: If a is greater than b, type shoul 阅读全文
摘要:
Implement the JavaScript Array.slice function in the type system. Slice<Arr, Start, End> takes the three argument. The output should be a subarray of 阅读全文
摘要:
It is useful to enable '@typescript-eslint/unbound-method': 'error', because this kind of error is related to this keyword, sometime it is hard to not 阅读全文