放送で紹介する用。書きかけです。
ちょっと伸びたのでさらに追記。これは元々自分の勉強がてら書いていたもので、これを書く過程でどうしても自分の理解では説明できないところがあり koba789 に依頼してペアプロをしてもらった、という流れがあります。その結果が次の動画です。
生放送の流れを円滑にするために資料を公開しましたが、この記事は未完成で、あとでさらに整理して別途記事にまとめるつもりです
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
- uses: actions/setup-node@v2 | |
with: |
use wasm_bindgen::prelude::Closure; | |
// あとで使う as_unchecked_ref は JsCast によって定義される trait | |
use wasm_bindgen::{JsCast, JsValue}; | |
fn main() -> Result<(), JsValue> { | |
// クリックすると値が増えるだけのカウンタを作る | |
let window = web_sys::window().unwrap(); | |
let document = window.document().unwrap(); | |
let body = document.body().unwrap(); |
放送で紹介する用。書きかけです。
ちょっと伸びたのでさらに追記。これは元々自分の勉強がてら書いていたもので、これを書く過程でどうしても自分の理解では説明できないところがあり koba789 に依頼してペアプロをしてもらった、という流れがあります。その結果が次の動画です。
生放送の流れを円滑にするために資料を公開しましたが、この記事は未完成で、あとでさらに整理して別途記事にまとめるつもりです
#[derive(Debug)] | |
enum List<T> { | |
Cons(T, Box<List<T>>), | |
Nil, | |
} | |
struct ListIterator<'a, T:'a> { | |
cur: &'a List<T> | |
} |
export type Point = { | |
t: 'point', | |
readonly x: number; | |
readonly y: number; | |
} | |
function get_distance(this: Point, other: Point) { | |
return Math.sqrt(Math.pow(this.x - other.x, 2) + Math.pow(this.y - other.y, 2)); | |
} | |
type Display<T> = { |
type StructFor<T extends symbol, O> = O & { t: T }; | |
function struct2<T extends symbol, O extends {}>(t: T): (o: O) => ({ t: T } & O) { | |
const builder = (o: O) => ({ t: t, ...o }); | |
return builder; | |
} | |
function create<S extends symbol, O extends {}>(t: S, o: O): StructFor<S, O> { | |
return { t, ...o }; | |
} |
use dioxus::prelude::*; | |
use wasm_bindgen::prelude::*; | |
use web_sys::console; | |
fn main() { | |
dioxus::web::launch(app); | |
} | |
fn app(cx: Scope) -> Element { | |
web_sys::console::log_1(&JsValue::from_str("render")); |
import ts, { servicesVersion } from "typescript"; | |
type Files = { [key: string]: string }; | |
type SourceFiles = { [key: string]: ts.SourceFile | undefined }; | |
function createHostedProgram(rawFiles: Files, root: string[]) { | |
} | |
import fs from "fs/promises"; | |
import path from "path"; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>EdgeJS test</h1> |
function isObject(value: any): value is object { | |
return value !== null && typeof value === 'object'; | |
} | |
export const DELETED = Symbol(); | |
export function deepProxy( | |
original: any, | |
handler: (path: string[], value: any | typeof DELETED) => void, | |
selfPath: string[] = [], |