Skip to content

Instantly share code, notes, and snippets.

View B-Anastasia's full-sized avatar

Anastasia Boshniak B-Anastasia

View GitHub Profile
@tomhicks
tomhicks / useTaskQueue.ts
Created January 11, 2021 11:41
React Hook for queueing and processing async tasks sequentially
function useTaskQueue(params: {
shouldProcess: boolean
}): {
tasks: ReadonlyArray<Task>
isProcessing: boolean
addTask: (task: Task) => void
} {
const [queue, setQueue] = React.useState<{
isProcessing: boolean
tasks: Array<Task>
@alexengrig
alexengrig / LiveTemplate-jsConsoleLog.md
Last active April 18, 2020 12:35
Live Template - js console.log(")

Live Template - js console.log(") for JetBrains

Go to Settings > Editor > Live Templates > JavaScript > Add (+)

Abbreviation:

log

Description:

Inserts console.log(")

Template text:

console.log('Class: $CLASS$, Function: $FUNCTION$, Line $LINE$ $PARAM_TEXT$($EXPECTED$): ', 
 $PARAM$);$END$