This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { reactive, type Reactive } from '@vue/reactivity'; | |
const width = 10; | |
const height = 10; | |
const numMines = 15; | |
export class Block { | |
constructor(public isVisible: boolean = false, public isMarked: boolean = false) {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function* readAllChunks(stream: ReadableStream<Uint8Array>) { | |
const reader = stream.getReader(); | |
const decoder = new TextDecoder("utf-8"); | |
while (true) { | |
const { value, done } = await reader.read(); | |
yield decoder.decode(value); | |
if (done) return; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("this is a simple log", 312); | |
console.info("what is info"); | |
console.info(_.reverse(_.array(1, 2, 3)), _.array("Hello", "World")); | |
console.error(_.set("1", "2", "2")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Root EditorConfig file | |
root = true | |
# Global settings (applies to all files) | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function use< | |
T extends { type: 'state'; value: unknown } | { type: 'memo'; fn: unknown }, | |
>( | |
parameters: T, | |
): T extends { type: 'state'; value: infer V } | |
? [V, React.SetStateAction<V>] | |
: T extends { type: 'memo'; fn: () => infer R } | |
? R | |
: never { | |
const { type } = parameters; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
function defineHooks<T extends unknown>(hooks: () => T) { | |
type Params = ReturnType<typeof hooks>; | |
return (props: { children: (params: Params) => JSX.Element }) => { | |
const { children } = props; | |
return children(hooks()); | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let context = { components: [] }; | |
function element(type, props, children) { | |
return React.createElement( | |
type, | |
props, | |
typeof children === 'function' ? children() : children, | |
); | |
} | |
const _ = new Proxy( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Dispatch, | |
memo, | |
SetStateAction, | |
useEffect, | |
ComponentType, | |
useMemo, | |
useState, | |
useCallback, | |
} from "react"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"remapKeys":{"inProcess":[{"originalKeys":"91","newRemapKeys":"162"},{"originalKeys":"164","newRemapKeys":"91"},{"originalKeys":"162","newRemapKeys":"164"}]},"remapShortcuts":{"global":[{"originalKeys":"162;32","newRemapKeys":"162;164;32"},{"originalKeys":"91;8","newRemapKeys":"163;8"},{"originalKeys":"91;37","newRemapKeys":"163;37"},{"originalKeys":"91;39","newRemapKeys":"163;39"},{"originalKeys":"91;160;37","newRemapKeys":"162;160;37"},{"originalKeys":"91;160;39","newRemapKeys":"162;160;39"},{"originalKeys":"91;162;37","newRemapKeys":"164;37"},{"originalKeys":"91;162;39","newRemapKeys":"164;39"}],"appSpecific":[{"originalKeys":"164;32","newRemapKeys":"162;32","targetApp":"code"},{"originalKeys":"162;8","newRemapKeys":"162;89","targetApp":"code"},{"originalKeys":"91;13","newRemapKeys":"164;13","targetApp":"code"},{"originalKeys":"91;162;76","newRemapKeys":"162;164;76","targetApp":"code"}]}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@asuka/di' | |
import { Ayanami, ImmerReducer, useAyanami, Effect, EffectAction } from 'ayanami' | |
import type { Draft } from 'immer' | |
import React from 'react' | |
import { Observable } from 'rxjs' | |
import { map, delay } from 'rxjs/operators' | |
type ActionBuilder<State extends Record<string, any>> = Record<string, (draft: Draft<State>, arg: any) => void> | |
type EffectBuilder<State extends Record<string, any>, Actions extends Record<string, (...args: any) => void>> = Record< |
NewerOlder