Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Tag SpecialKey #224

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/Instances/Tags.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--!strict

--[[
A special key for property tables, which assigns CollectionService tags
to instances.
]]

local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local logWarn = require(Package.Logging.logWarn)
local xtypeof = require(Package.Utility.xtypeof)

local Tags = {}
Tags.type = "SpecialKey"
Tags.kind = "Tags"
Tags.stage = "observer"

function Tags:apply(tags: any, applyTo: Instance, cleanupTasks: {PubTypes.Task})

end

return Tags :: PubTypes.SpecialKey
2 changes: 2 additions & 0 deletions src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Fusion = {
Attribute: (attributeName: string) -> PubTypes.SpecialKey,
AttributeChange: (attributeName: string) -> PubTypes.SpecialKey,
AttributeOut: (attributeName: string) -> PubTypes.SpecialKey,
Tags: PubTypes.SpecialKey,

Value: <T>(initialValue: T) -> Value<T>,
Computed: <T>(callback: () -> T, destructor: (T) -> ()?) -> Computed<T>,
Expand Down Expand Up @@ -62,6 +63,7 @@ return restrictRead("Fusion", {
Attribute = require(script.Instances.Attribute),
AttributeChange = require(script.Instances.AttributeChange),
AttributeOut = require(script.Instances.AttributeOut),
Tags = require(script.Instances.Tags),

Value = require(script.State.Value),
Computed = require(script.State.Computed),
Expand Down