Catwork is a declarative, asynchronous object framework that motivates you to write safer, asynchronous code.
Simple to use, but powerful
Catwork code can be placed in a Script
, or ModuleScript
, it runs the same way regardless as objects are run on creation and not when they’re returned.
Catwork.new {
Init = function(self)
print("Hello World!")
end
}
Asynchronous by design
If your code yields, you can await upon it in other Catwork objects
local YieldingObject = require(script.YieldingObject)
Catwork.new {
[Catwork.meta "AwaitFor"] = {
YieldingObject
-- preferred way of doing this
},
Init = function(self)
-- if you alternatively want to handle the response of an awaiting call
-- do not use with AwaitFor because you just do the same thing twice
local ok, err = YieldingObject:Await()
end
}
Extensible
Services allow you to expand Catwork beyond what it was originally designed for.
Catwork.Service {
Name = "BoopYourObject",
CreateObject = function(self, params)
params.Boopable = true
end
}
A great example of a service can be viewed here which wraps CollectionService into tag handlers.
Installation
Catwork is provided as both an rbxm
and zip
file on GitHub. We do not maintain Wally packages though they are present.
For Roblox users, you can simply drag the RBXM into ReplicatedFirst and start coding straight away with Catwork!
For developers who use other solutions, simply unpack the zip file and drag it into your ReplicatedFirst section of your project
Why use ReplicatedFirst
ReplicatedFirst is always loaded first, and you may want to write code that is processed before anything else.
Attributions
- Quick Link logos made by @2jammers - Forum Post
- Catwork Logo made by @alex@nede.re