This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose access to GetPropertyChangedSignal (#51)
- Loading branch information
1 parent
26f0579
commit bbb0663
Showing
7 changed files
with
175 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
local Change = {} | ||
|
||
local changeMetatable = { | ||
__tostring = function(self) | ||
return ("ChangeListener(%s)"):format(self.name) | ||
end | ||
} | ||
|
||
setmetatable(Change, { | ||
__index = function(self, propertyName) | ||
local changeListener = { | ||
type = Change, | ||
name = propertyName | ||
} | ||
|
||
setmetatable(changeListener, changeMetatable) | ||
Change[propertyName] = changeListener | ||
|
||
return changeListener | ||
end, | ||
}) | ||
|
||
return Change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
return function() | ||
local Change = require(script.Parent.Change) | ||
|
||
it("should yield change listener objects when indexed", function() | ||
expect(Change.Text).to.be.ok() | ||
expect(Change.Selected).to.be.ok() | ||
end) | ||
|
||
it("should yield the same object when indexed again", function() | ||
local a = Change.Text | ||
local b = Change.Text | ||
|
||
expect(a).to.equal(b) | ||
end) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters