-
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Type: Buffer
Аниса edited this page Sep 9, 2022
·
9 revisions
Buffers beside serving as cache are also important for simplifying complex modules. Vital.kit reutilizes Class
to simulate buffers, thus reducing code redundancy!
Our extensions are written with backwards compatibility in mind; Expect your previous code to work as usual! However we recommend upgrading to newer syntax.
const class: cBuffer = vKit.Buffer(
string: category // Category of the buffer
)
// Note: Avoid exposing the entire class to another scripts unless needed, otherwise just expose 'cBuffer.public'
cBuffer: {
public, // Public variables must be appended here
private, // Private variables must be appended here
instance // Instances are stored here
}
const bool: state = cBuffer.public.isVoid(
string: ref
)
const instance: cInstance = cBuffer.public.fetch(
string: ref
)
const instance: cInstance = cBuffer.public.create(
string: ref
)
const bool: state = cBuffer.public.destroy(
string: ref
)
const bool: state = cInstance.destroy()