1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00

Merge pull request #78 from yoanngueny/master

fix removeListener index
This commit is contained in:
Kevin LEVRON 2021-07-02 13:24:43 +02:00 committed by GitHub
commit c611533929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,7 +238,7 @@ export default defineComponent({
removeListener(type: string, cb: {(e?: any): void}) {
const callbacks = this.getCallbacks(type)
const index = callbacks.indexOf(cb)
if (index) callbacks.splice(index, 1)
if (index !== -1) callbacks.splice(index, 1)
},
getCallbacks(type: string) {