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
| defmodule Monad.Result do | |
| @type result_t(value, error) :: ok_t(value) | error_t(error) | |
| @type ok_t(a) :: {:ok, a} | |
| @type error_t(a) :: {:error, a} | |
| @spec map(result_t(v, e), (v -> b)) :: result_t(b, e) when v: term(), b: term(), e: term() | |
| def map({:ok, val}, f), do: {:ok, f.(val)} | |
| def map({:error, _val} = err, _f), do: err | |
| @spec map_err(result_t(any(), a), (a -> b)) :: result_t(any(), b) when a: term(), b: term() |
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 { DESKTOP_WIDTH } from '@remember_web/ui'; | |
| import { useMedia, useUpdateEffect } from 'react-use'; | |
| type UseMobileSizeProps = { | |
| isDefaultMobile?: boolean; | |
| onMediaChange?: (isMobile: boolean) => void; | |
| }; | |
| export const useMobileSize = ({ | |
| isDefaultMobile = false, | |
| onMediaChange, |
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
| /** | |
| * union -> { [k in keyof union]: string} ํ์ ๋ณํ | |
| * @example | |
| * MakeObjFromKeys<'studentId' | 'favoriteId', string> | |
| * => { studentId: string; favoriteId: string } | |
| */ | |
| export type MakeObjFromKeys<Keys extends string, V> = { [K in Keys]: V }; | |
| const prefix = ':' as const; | |
| export type Prefix = typeof prefix; |
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, { createContext, useCallback, useContext, useMemo, useRef, useSyncExternalStore } from "react"; | |
| type MakeStoreProps<T> = { | |
| name: string | |
| initial: T | |
| } | |
| type Subscriber = () => void | |
| type SubscriberStore<T> = { | |
| get() : T |