Skip to content

Instantly share code, notes, and snippets.

View Pruxis's full-sized avatar
🤌

Laurens Lavaert Pruxis

🤌
  • introw.io
  • Belgium
View GitHub Profile
@Pruxis
Pruxis / promptManager.ts
Last active August 5, 2023 21:57
Prompt Manager for RedM
export interface PromptAttributes {
text: string;
// Use the native key hash to set the control
control: number;
mode?: "standard" | "hold" | "mash" | "mash_infinite";
mashAmount?: number;
// When using mash mode this function is called indefinitely, make sure to either handle this properly
// Or to utilise "once" from Lodash for example to make sure the function is only called once.
onSuccess: Function;
// Only called during mash mode.
@Pruxis
Pruxis / machine.js
Last active October 30, 2019 12:56
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'preprocessing',
context: {
retries: 0,
},
states: {
preprocessing: {
on: {
ERROR: 'manualIntervention',