Join Slack
Powered by
Ok, I have a kotlin to javascript conversion quest...
# javascript
j
John Lutteringer
04/26/2018, 10:29 PM
Ok, I have a kotlin to javascript conversion question. Lets say I am using an external javascript library which rebinds 'this' on a callback that you pass in. How do I construct a lambda in kotlin that can simulate this behavior?
b
bashor
04/27/2018, 8:36 PM
Unfortunately, there no (good) type-safe way to achieve it yet. The related issue:
https://youtrack.jetbrains.com/issue/KT-15140
bashor
04/27/2018, 8:36 PM
The possible workaround is using
js("this")
for accessing to context object
Open in Slack
Previous
Next