@rbxts/tether 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,16 @@ export function rateLimit(interval: number): SharedMiddleware {
|
|
|
87
87
|
}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
#### Transforming data
|
|
91
|
+
```ts
|
|
92
|
+
import type { ServerMiddleware } from "@rbxts/tether";
|
|
93
|
+
|
|
94
|
+
export function incrementNumberData<T extends number>(): ServerMiddleware<T> {
|
|
95
|
+
return () => (data, updateData) =>
|
|
96
|
+
updateData(data as T + 1 as T); // sets the data to be used by the any subsequent middlewares as well as sent through the remote
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
90
100
|
### Using middleware
|
|
91
101
|
```ts
|
|
92
102
|
import type { DataType } from "@rbxts/flamework-binary-serializer";
|