Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 511 Bytes

README.md

File metadata and controls

30 lines (26 loc) · 511 Bytes

Overview

A stack-based Janitor implementation written in Luau for the Roblox platform with a TypeScript support.

Basic usage

const janitor = new Janitor()
	.addFn(() => {
		warn("third");
	})
	.addFn(() => {
		warn("second");
	})
	.addFn(() => {
		warn("first after connection was cleaned up");
	})
	.addConnection(
		game.DescendantAdded.Connect(() => {
			// some code
		})
	);

task.delay(1, () => {
    janitor.destroy()
    // or
    janitor.cleanup()
    // for further cleanup tasks
})