Skip to content

Instantly share code, notes, and snippets.

View olpeh's full-sized avatar
🌳
Branch Manager at Iltametsuri

Olavi Haapala olpeh

🌳
Branch Manager at Iltametsuri
View GitHub Profile
@olpeh
olpeh / _app.tsx
Last active May 10, 2021 06:51
Loading indicator between pages during navigation in Next.js – one option
import React, { useEffect, useState } from "react";
import { useRouter } from "next/router";
import type { AppProps } from "next/app";
const App = ({ Component, pageProps }: AppProps) => {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
const handleRouteChangeStart = () => {
@olpeh
olpeh / RemoteData.ts
Created June 10, 2019 06:12
RemoteData in TypeScript
import { Status } from './Status';
export const NotAsked: NotAsked = {
status: Status.NotAsked
};
export interface NotAsked {
status: Status.NotAsked;
}

Keybase proof

I hereby claim:

  • I am olpeh on github.
  • I am olpe (https://keybase.io/olpe) on keybase.
  • I have a public key whose fingerprint is 4F55 6A9B A1A0 8DE0 0088 77C6 6B6E DDAD 14ED 2226

To claim this, I am signing this object: