The Namespace Object
Last updated
Last updated
Namespacing is the act of wrapping a set of entities, variables, functions, and objects under a single umbrella term. The Koii Namespace object namespace
is a global wrapper for all APIs needed in Koii tasks.
This JavaScript object is injected into a Koii task by the Task Node running the task, and the Koii task has access to all wrapped utilities. Below is an example of accessing the utility from the namespace
object:
The Namespace object is important for a number of reasons, some of which are:
It protects and isolates the code from other applications.
It prevents memory leakage.
It ensures code is organized, easy to read, and refactor according to necessary requirements.
It is easy to recognize the variables and functions from where they are defined.
The Namespace object can be expanded by including unique utilities when a Koii task is created. More information on this is discussed in this .