This file contains 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() { | |
"use strict"; | |
const hashIteration = seq => seq.join(","); | |
const nextIteration = seq => | |
seq.map((num, index, array) => | |
Math.abs(num - array[(index + 1) % array.length]) | |
); | |
function* ducciSequence(initialValue = []) { |
This file contains 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; Color Picker | |
; Usage: place mouse pointer over desired color then input "Win key + \ ", | |
; The picked color will be on the clipboard in rbg format | |
; https://www.autohotkey.com/docs/KeyList.htm | |
CoordMode, PixelGetColor, Screen |
This file contains 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 { Middleware } from 'redux'; | |
import { isAnyOf, ActionMatchingAnyOf } from '@reduxjs/toolkit'; | |
import { AppMiddlewareApi } from 'store/types'; | |
export interface OnActionListener<T> { | |
(action: T, middlewareApi: AppMiddlewareApi): void; | |
} | |
export interface OnListenerError<T> { | |
(error: unknown, action?: T): void; |
This file contains 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
diff --git a/packages/action-listener-middleware/src/index.ts b/packages/action-listener-middleware/src/index.ts | |
index 8850cff..5c1fe54 100644 | |
--- a/packages/action-listener-middleware/src/index.ts | |
+++ b/packages/action-listener-middleware/src/index.ts | |
@@ -67,51 +67,47 @@ const actualMiddlewarePhases = ['beforeReducer', 'afterReducer'] as const | |
function createTakePattern<S>( | |
addListener: AddListenerOverloads<Unsubscribe, S, Dispatch<AnyAction>>, | |
- parentJob?: Job<any> | |
+ parentJob: Job<any> |
This file contains 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
export interface Task<T> extends Promise<T> { | |
/** | |
* The abort signal of the task | |
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | |
*/ | |
signal: AbortSignal | |
/** | |
* Cancel a task only if it has not been settled. | |
* @param reason | |
*/ |
This file contains 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 { counterActions } from './slice'; | |
import { AppListenerEffectAPI } from './store'; | |
export async function addOneToIncrementBy( | |
{ payload }: ReturnType<typeof counterActions.incrementByAmount>, | |
listenerApi: AppListenerEffectAPI | |
) { | |
listenerApi.dispatch(counterActions.increment()) | |
} |
This file contains 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 { | |
combineReducers, | |
configureStore, | |
EnhancedStore, | |
Middleware, | |
} from '@reduxjs/toolkit'; | |
import type { BaseQueryFn, FetchArgs } from '@reduxjs/toolkit/query'; | |
export type MockBaseQuery< | |
Result, |
This file contains 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
use wasmer::Memory; | |
use crate::config::{self, memory::FRAMEBUFFER}; | |
use std::{cell::Cell, cmp}; | |
const SCREEN_WIDTH_I32: i32 = config::WIDTH as i32; | |
const SCREEN_HEIGHT_I32: i32 = config::HEIGHT as i32; | |
pub(crate) trait Extract<T> { | |
fn extract(&self) -> T; |
This file contains 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
{ | |
"editor.formatOnSave": true, | |
"typescript.preferences.importModuleSpecifier": "non-relative", | |
"editor.tabSize": 2, | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[javascriptreact]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, |
This file contains 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
/* eslint-disable prefer-spread, consistent-return */ | |
import { useEffect, useLayoutEffect, useRef } from 'react' | |
type Nullable<T> = T | null | |
type EventHandler<T, E> = (this: T, evt: E) => any | |
export type GetAddListenerOptions = { | |
(eventType: string): AddEventListenerOptions | boolean | undefined | |
} |
OlderNewer