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
function useTaskQueue(params: { | |
shouldProcess: boolean | |
}): { | |
tasks: ReadonlyArray<Task> | |
isProcessing: boolean | |
addTask: (task: Task) => void | |
} { | |
const [queue, setQueue] = React.useState<{ | |
isProcessing: boolean | |
tasks: Array<Task> |
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 ts_module from 'typescript/lib/tsserverlibrary'; | |
/** Log to the TS Server log */ | |
function log(info: ts.server.PluginCreateInfo, message: string) { | |
info.project.projectService.logger.info(`[My TS Server Plugin] ${message}`); | |
} | |
// https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin | |
export default function init({ typescript: ts }: { typescript: typeof ts_module }) { | |
return { |