Skip to content

Instantly share code, notes, and snippets.

View YasushiKobayashi's full-sized avatar

YasushiKobayashi YasushiKobayashi

View GitHub Profile
@haya14busa
haya14busa / main.go
Created November 1, 2016 23:32
サンプル: Golangにおけるinterfaceをつかったテストで mock を書く技法
package main
import (
"context"
"fmt"
)
type GitHub interface {
CreateRelease(ctx context.Context, opt *Option) (string, error)
GetRelease(ctx context.Context, tag string) (string, error)
@hrdtbs
hrdtbs / react-hooks_exhaustive-deps.md
Last active October 10, 2023 09:36
メモ、なぜ`react-hooks/exhaustive-deps`はただcomponentDidMountのように使いたいだけなのに依存関係を入れてくるのか

なぜreact-hooks/exhaustive-depsはただcomponentDidMountのように使いたいだけなのに依存関係を入れてくるのか

export const Example = ({ loadOnlyOnce }) => {
    useEffect(() => {
      loadOnlyOnce()
    }, [loadOnlyOnce]) // ← WHY?
}