上一页 1 ··· 59 60 61 62 63 64 65 66 67 ··· 496 下一页
摘要: An example of callback implemnetation for handling async flow: function fakeAjax(url, cb) { var fake_responses = { file1: "The first text", file2: "Th 阅读全文
posted @ 2023-10-17 15:03 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: Let's say you're creating a component that has all the props of input but needs to add a label prop. You'll need to extend from the ComponentProps typ 阅读全文
posted @ 2023-10-10 14:59 Zhentiw 阅读(26) 评论(0) 推荐(0)
摘要: 1. Basic version of signals We have a basic version of signal: const stack = [] export function createSignal(value) { const subscribers = new Set(); c 阅读全文
posted @ 2023-10-06 15:07 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: import { Configuration, OpenAIApi } from "openai"; import { process } from './env'; const configuration = new Configuration({ apiKey: process.env.OPEN 阅读全文
posted @ 2023-10-06 03:02 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: Implement two functions of Signals createSignal: return a tuple with read function and wrtie function createEffect: accept a function which will be ex 阅读全文
posted @ 2023-10-05 16:16 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: Let’s make using the observers asynchronous! This way we can update the data and have multiple observers run asynchronously. class AsyncData { constru 阅读全文
posted @ 2023-10-04 15:31 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: PubSub is one of the most foundational patterns for reactivity. Firing an event out with publish() allows anyone to listen to that event subscribe() a 阅读全文
posted @ 2023-10-04 02:19 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要: import { afterEach, test, expect, vi, beforeEach } from 'vitest'; import { render } from 'test/utilities'; import TimeZone from '.'; beforeEach(() => 阅读全文
posted @ 2023-09-27 21:39 Zhentiw 阅读(56) 评论(0) 推荐(0)
摘要: 1. Globally import In vitest, you need to do import { it, expect, test } from 'vitest'; In every test files, If you don't want to do it you can set co 阅读全文
posted @ 2023-09-20 01:33 Zhentiw 阅读(87) 评论(0) 推荐(0)
摘要: type WidenLiteral<T> = T extends string | number | boolean ? ReturnType<T["valueOf"]> : T; type Example1 = WidenLiteral<"abc"> // string type Example2 阅读全文
posted @ 2023-09-20 01:29 Zhentiw 阅读(19) 评论(0) 推荐(0)
上一页 1 ··· 59 60 61 62 63 64 65 66 67 ··· 496 下一页