⚔️Global Utility Functions
Global functions are the unsung heroes that transcend the boundaries of specific data types, providing a universal toolkit for developers. These functions, residing in the global scope, are the go-to tools when you need versatile and expressive solutions that operate seamlessly across various data structures.
Meet some Ingredients
runIt(): The maestro orchestrating the symphony of functions, runIt calls a specified function block and presents its harmonious result.
withIt(): The chameleon of functions, withIt transforms any object into the star of the show, letting it shine in a function block tailored just for them.
listOf() and setOf(): Assemble an immutable collection of elements effortlessly with listOf or setOf. It's your go-to for creating collections in a concise and readable manner.
mutableListOf() or mutableSetOf(): When you need a dynamic collection that can evolve with your needs, turn to mutableListOf or mutableSetOf to create mutable collection with ease.
optionalOf(): Embrace the power of optionals with optionalOf, a function that lets you gracefully handle scenarios with potentially absent values.
durationOf(): Time is of the essence, and durationOf allows you to craft time durations with precision, making time manipulation a breeze.
reducerOf(): Transform your data with reducerOf, a function designed for building reducers that streamline complex state transformations in a functional paradigm.
rangeTo(): Define ranges effortlessly with rangeTo, a function simplifying the creation of numeric ranges for iteration or data selection.
ok(): Indicate success with confidence using ok. This function constructs an "ok" result, signalling that a task or operation was completed successfully.
error(): Handle errors gracefully with error. This function constructs an error result, encapsulating details about the failure and allowing for structured error handling.
These are just a smell of the utility this library brings to the table. Please, check the complete list in the Global Functions section.
Last updated