上一页 1 ··· 89 90 91 92 93 94 95 96 97 ··· 496 下一页
摘要: Implement the advanced util type MutableKeys, which picks all the mutable (not readonly) keys into a union. For example: type Keys = MutableKeys<{ rea 阅读全文
posted @ 2022-11-30 14:48 Zhentiw 阅读(39) 评论(0) 推荐(0)
摘要: Invoke by Promise: import { createMachine, interpret, send } from "xstate"; const machine = createMachine({ initial: "loading", states: { loading: { o 阅读全文
posted @ 2022-11-30 02:07 Zhentiw 阅读(61) 评论(0) 推荐(0)
摘要: function countBehavior(state, event) { if (event.type "INC") { return { ...state, count: state.count + 1 } } } function createActor(behavior, initialS 阅读全文
posted @ 2022-11-30 01:35 Zhentiw 阅读(42) 评论(0) 推荐(0)
摘要: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries Use the container-type property a value of size, inline-size, or normal. These 阅读全文
posted @ 2022-11-29 15:41 Zhentiw 阅读(114) 评论(0) 推荐(0)
摘要: Implement type IsPalindrome<T> to check whether a string or number is palindrome. For example: IsPalindrome<'abc'> // false IsPalindrome<121> // true 阅读全文
posted @ 2022-11-29 15:14 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: Implement the type version of Object.fromEntries For example: interface Model { name: string; age: number; locations: string[] | null; } type ModelEnt 阅读全文
posted @ 2022-11-28 15:54 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要: Implement a generic GetReadonlyKeys<T> that returns a union of the readonly keys of an Object. For example interface Todo { readonly title: string rea 阅读全文
posted @ 2022-11-27 19:47 Zhentiw 阅读(148) 评论(0) 推荐(0)
摘要: import { Machine, actions } from "xstate"; const { raise } = actions; // Demostrate `raise` action const stubbornMachine = Machine({ id: "raisedmo", i 阅读全文
posted @ 2022-11-26 17:50 Zhentiw 阅读(51) 评论(0) 推荐(0)
摘要: Implement a generic IsRequiredKey<T, K> that return whether K are required keys of T . For example type A = IsRequiredKey<{ a: number, b?: string },'a 阅读全文
posted @ 2022-11-26 16:27 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: Implement the generic ClassPublicKeys<T> which returns all public keys of a class. For example: class A { public str: string protected num: number pri 阅读全文
posted @ 2022-11-26 16:14 Zhentiw 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 89 90 91 92 93 94 95 96 97 ··· 496 下一页