# Function binding in TS

**URL:** <https://forum.heroiclabs.com/t/function-binding-in-ts/2855>\
**Category:** Runtime Framework\
**Tags:** server-framework, typescript\
**Created:** [July 21, 2022, 11:56am UTC](https://forum.heroiclabs.com/t/function-binding-in-ts/2855 "2022-07-21T11:56:11Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![JayArrowz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jayarrowz/32/1228_2.png) [@JayArrowz](https://forum.heroiclabs.com/u/JayArrowz)\
**Post date:** [July 23, 2022, 11:28pm UTC](https://forum.heroiclabs.com/t/function-binding-in-ts/2855/7 "2022-07-23T23:28:54Z")

</div>

@formatCvt damn :S im hoping this is not the case, cause most of my state is objects such as Player class etc… I never saw this in any doc either

@sesposito here is my issue on this repo:  
[JayArrowz/NakamaTypescript: Nakama TS ([github.com](http://github.com))] ([GitHub - JayArrowz/NakamaTypescript: Nakama TS](https://github.com/JayArrowz/NakamaTypescript))

Please run `npm install` first.  
You can use `npm run run` to run the docker container or `npm run build` to transpile

You’ll notice the error inside the match loop when you reference myClass.getInteger().

`{"level":"warn","ts":"2022-07-23T23:57:11.138Z","caller":"server/match_handler.go:295","msg":"Stopping match after error from match_loop execution","mid":"4f29f600-e232-48ef-8fa8-87865feb062f","tick":0,"error":"TypeError: Object has no member 'getInteger' at matchLoop (index.js:61:54(9))"}`

Now if i use this implementation of MyClass it works:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/heroiclabs/original/2X/8/8c4858f91791a56b7f82145eb90589f059dae508.png)

---

_[View the full topic](https://forum.heroiclabs.com/t/function-binding-in-ts/2855)._
