Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing inject _this object. #7

Open
kalwalt opened this issue Jan 25, 2023 · 1 comment
Open

Removing inject _this object. #7

kalwalt opened this issue Jan 25, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@kalwalt
Copy link
Member

kalwalt commented Jan 25, 2023

In various part of the code we can found var _this = this because otherwise the this object is unvailable, because the use of nested functions example in ArToolkitContext in the init function:

var _this = this;

and then after:
function done() {
// dispatch event
_this.dispatchEvent({
type: "initialized",
});
_this.initialized = true;
onCompleted && onCompleted();
}

maybe we can rewrite these functions?

@kalwalt kalwalt added the enhancement New feature or request label Jan 25, 2023
@kalwalt
Copy link
Member Author

kalwalt commented Mar 29, 2024

maybe intead of using the _this variable trick we can use bind() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant