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 * as S from "@effect/schema/Schema"; | |
import { Assume, Column, Equal, Table, getTableColumns, is } from "drizzle-orm"; | |
import { | |
MySqlChar, | |
MySqlVarBinary, | |
MySqlVarChar, | |
} from "drizzle-orm/mysql-core"; | |
import { PgArray, PgChar, PgUUID, PgVarchar } from "drizzle-orm/pg-core"; | |
import { SQLiteText } from "drizzle-orm/sqlite-core"; | |
import { Simplify } from "effect/Types"; |
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 { db } from "../services/db.server"; | |
import { Data, Effect } from "effect"; | |
import type { PrismaClient } from "@prisma/client"; | |
import type { | |
PrismaClientKnownRequestError, | |
PrismaClientUnknownRequestError, | |
PrismaClientRustPanicError, | |
PrismaClientInitializationError, | |
PrismaClientValidationError, | |
} from "@prisma/client/runtime/library"; |
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
// This hook returns what the value was previously | |
// even across multiple renders | |
// (correct for the | |
// "<button>Value: {value}, previous: {previousValue}</button>" | |
// use case. | |
function usePreviousValue(value, defaultValue) { | |
const [prev, setPrev] = useState(defaultValue); | |
const next = useRef(); | |
useEffect(() => { | |
const old = next.current; |
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
const { sqrt, floor } = Math | |
type Sequence<T> = T[] | |
/* | |
Get sequence of items from the first sequence in the | |
initial order excluding items which occur in the second | |
sequence prime number of times. |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |