Skip to content

Instantly share code, notes, and snippets.

View kotarella1110's full-sized avatar
🏠
Working from home

Kotaro Sugawara kotarella1110

🏠
Working from home
View GitHub Profile
@shqld
shqld / Terser & Babel の好きなところ.md
Last active December 20, 2023 15:27
個人的にTerser & Babelの好きなところ

だれ?

(credit: @tomo_e さん)

  • 新卒 2 年目
  • ウェブチーム
@azu
azu / READ.md
Last active May 8, 2021 14:23
JavaScriptの本を書くときに参考にしてるもの

jsprimerというJavaScriptの書籍を書いている。 これを書いてるときに参考にしているものを書いていく。

ECMAScriptのLiving Standardな仕様書ページ。 スナップショットなECMAScriptの仕様書ページもあるけど、基本的にはLiving Standardの方しか見てない。

@gaearon
gaearon / uselayouteffect-ssr.md
Last active May 2, 2025 03:01
useLayoutEffect and server rendering

If you use server rendering, keep in mind that neither useLayoutEffect nor useEffect can run until the JavaScript is downloaded.

You might see a warning if you try to useLayoutEffect on the server. Here's two common ways to fix it.

Option 1: Convert to useEffect

If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect instead.

function MyComponent() {
@bvaughn
bvaughn / LICENSE.md
Last active April 27, 2025 22:07
Advanced example for manually managing subscriptions in an async-safe way using hooks

The MIT License (MIT)

Copyright © <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

@azu
azu / README.md
Last active April 25, 2025 13:16
スタートアップ/企業の調べ方
@mizchi
mizchi / how-hooks-work.md
Last active December 24, 2024 01:48
(翻訳) React Hooks は魔法ではなく、ただの配列だ

(翻訳) React Hooks は魔法ではなく、ただの配列だ

この記事は https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-cd4f1857236e の日本語訳です。途中で力尽きて雑な翻訳になってる箇所がいくつかあります。


どのように Hooks が動いているか

私は、新しい Hooks の API の "magic" な挙動に悩んでいる人が結構いると聞いています。なのでこの構文の提案が、少なくとも表面的なレベルではどう動いているか、解説してみようと思います。

// Builderオブジェクトの型
type Builder<Props, Result> = ({} extends Props
? {
build: () => Result;
}
: {}) &
{ [P in keyof Props]-?: SetFunction<Props, P, Result> };
type SetFunction<Props, K extends keyof Props, Result> = (
value: Exclude<Props[K], undefined>
@swalkinshaw
swalkinshaw / tutorial.md
Last active July 20, 2025 07:39
Designing a GraphQL API

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

[JavaScript] オブジェクト, Map, WeakMap の使い分け方

概要

JavaScript で下記4点を連想配列として用いる場合の使い分け方を解説します。

  • オブジェクト初期化子
  • Object.create(null)
  • Map
  • WeakMap