Skip to content

Cached

In light, you can use lua table syntax to represent a Datatype, and it'll be converted automatically when you use it in a Message.

This API exists to manually cache the result of a Datatype. This will internally turn it into a numeric ID if it isn't one already, rendering it unusable for anything other than ser/des and messages. Messages cache their Datatypes automatically, but using this can give you extra performance.

function light.datatypes.cached

Shared Synchronous
1
2
3
function cached<T>(
   value: Datatype<T>
): (Datatype<T>)