Skip to content

Instantly share code, notes, and snippets.

View emekaorji's full-sized avatar
👣
in a waverider

Emeka Orji emekaorji

👣
in a waverider
View GitHub Profile
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
@emekaorji
emekaorji / useElectronStore.js
Last active February 8, 2024 23:03
A react hook to establish a sync with the electron store with real-time updates.
import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';
function useStoreState<T>(
_key: string,
_initialValue: T | (() => T)
): [T, Dispatch<SetStateAction<T>>];
function useStoreState<T = undefined>(
_key: string
): [T | undefined, Dispatch<SetStateAction<T | undefined>>];
@emekaorji
emekaorji / symlx-ts-node-shebang-change.md
Created March 10, 2026 10:11
symlx: explicit failure for TS targets with node shebang

symlx change request: fail early for TS targets with node shebang

Problem

A TypeScript bin target can currently be direct-linked when it has a shebang, even if that shebang is node. This leads to runtime failures like:

  • ERR_UNKNOWN_FILE_EXTENSION: Unknown file extension ".ts"

for targets such as src/bin/zestman.ts.