Skip to content

Commit 921f836

Browse files
committed
v4.1.1
1 parent 08af04f commit 921f836

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
# roblox-ts stuff
12
/node_modules
23
/out
34
/include
45
*.tsbuildinfo
6+
7+
# Packed packages
8+
rbxts-binder-*.*.tgz

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.tsbuildinfo

README.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# @rbxts/binder
1+
## @rbxts/binder
22

3-
Typings for Quenty's Binder (a Nevermore module), a module uses CollectionService to make tagged objects run by its own custom component classes
3+
Typings for Quenty's Binder (a Nevermore module)
44

55
## Installation
66

7-
```
8-
npm i @rbxts/binder
9-
```
7+
**NPM**:
8+
`npm i @rbxts/binder`
9+
10+
**Yarn**:
11+
`yarn add @rbxts/binder`
1012

1113
## Usage
1214

@@ -17,10 +19,7 @@ class Disco implements Binder.BinderClass {
1719
Instance: Part;
1820

1921
constructor(instance: Instance) {
20-
assert(
21-
classIs(instance, "Part"),
22-
"Instance parameter must be Part instance",
23-
);
22+
assert(classIs(instance, "Part"), "Invalid argument #1, Part expected");
2423
this.Instance = instance;
2524
}
2625

@@ -34,9 +33,28 @@ class Disco implements Binder.BinderClass {
3433
const discoBinder = new Binder("Disco", Disco);
3534
discoBinder.Start();
3635

37-
game
38-
.GetService("RunService")
39-
.Heartbeat.Connect(() =>
40-
discoBinder.GetAll().forEach((object) => object.Update()),
41-
);
36+
// have some party!
37+
game.GetService("RunService").Heartbeat.Connect(() => {
38+
for (const object of discoBinder.GetAll()) {
39+
object.Update();
40+
}
41+
});
42+
```
43+
44+
## Differences from the Luau version of Binder
45+
46+
### Creating Binder class
47+
48+
When creating Binder implemented class, make sure the first parameter
49+
of the constructor function must be `Instance` type.
50+
51+
**Example**:
52+
```ts
53+
class DummyClass implements BinderClass {
54+
constructor(instance: Instance) {
55+
print(`${instance.GetFullName()} spawned!`);
56+
}
57+
58+
Destroy() {}
59+
}
4260
```

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "@rbxts/binder",
3-
"version": "1.0.4",
3+
"version": "4.1.1-ts.0",
44
"description": "Typings for Quenty's Binder module",
55
"main": "out/init.lua",
66
"scripts": {
7-
"prepublishOnly": "rbxtsc"
7+
"prepublishOnly": "rbxtsc",
8+
"prepack": "rbxtsc"
89
},
9-
"keywords": [],
10+
"keywords": ["Roblox", "Lua"],
1011
"author": "memothelemo",
1112
"license": "MIT",
1213
"types": "out/index.d.ts",

0 commit comments

Comments
 (0)