{"id":"captalbator/observer","name":"observer","scope":"captalbator","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"5b9cadee70bdb6a675cbbbc2cd22c44c16791fc1227c7770271f1257e6516442","likes":0,"downloads":0,"install":"forest install captalbator/observer","url":"https://forest.dev/p/roblox/captalbator/observer","files":"https://api.forest.dev/ai/package/roblox/captalbator/observer/files","readme":"# Observer\n\nA module for observing tagged instances and attributes.\n\n# Installation\n\nInstall using wally: `Observer = \"captalbator/observer@0.1.0\"`\n\n# Example\n\n```lua\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal RunService = game:GetService(\"RunService\")\n\nlocal Observer = require(ReplicatedStorage.Packages.Observer)\n\nObserver.ObserveTag(\"Rotate\", function(instance)\n    local startingCFrame = instance.CFrame\n\n    local rotationSpeed = 1\n    -- ObserveAttribute runs once when called and again every time the attribute changes\n    Observer.ObserveAttribute(instance, \"RotationSpeed\", function(newSpeed: number)\n        rotationSpeed = newSpeed\n    end)\n\n    local rotateConnection = RunService.RenderStepped:Connect(function()\n        instance.CFrame = startingCFrame * CFrame.Angles(0, (os.clock() % 6.28) * rotationSpeed, 0)    \n    end)\n\n    -- Cleanup function, called when the instance is removed\n    return function()\n        rotateConnection:Disconnect()\n    end\nend, { Workspace }) -- The third argument is optional and defaults to { Workspace }\n\n```\n","readmeTruncated":false}