Skip to content

Commit e564dab

Browse files
fix: Use mitt to handle events
1 parent 7efcbbc commit e564dab

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

package-lock.json

Lines changed: 11 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"decentraland-ui": "^3.49.0",
2323
"deep-equal": "^2.0.5",
2424
"fp-future": "^1.0.1",
25+
"mitt": "^3.0.1",
2526
"prettier": "^2.4.1",
2627
"raw-loader": "^4.0.2",
2728
"react": "^17.0.2",
@@ -65,8 +66,5 @@
6566
"singleQuote": true,
6667
"printWidth": 120
6768
},
68-
"homepage": "",
69-
"devDependencies": {
70-
"@foxify/events": "^2.1.0"
71-
}
69+
"homepage": ""
7270
}

src/lib/babylon/emote.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import EventEmitter from '@foxify/events'
1+
import mitt from 'mitt'
22
import {
33
AnimationGroup,
44
ArcRotateCamera,
@@ -247,14 +247,14 @@ function createController(animationGroup: AnimationGroup, loop: boolean, sound:
247247

248248
// Temporary typed events.
249249
type Events = {
250-
[PreviewEmoteEventType.ANIMATION_PLAY]: () => unknown
251-
[PreviewEmoteEventType.ANIMATION_PAUSE]: () => unknown
252-
[PreviewEmoteEventType.ANIMATION_LOOP]: () => unknown
253-
[PreviewEmoteEventType.ANIMATION_END]: () => unknown
254-
[PreviewEmoteEventType.ANIMATION_PLAYING]: ({ length }: { length: number }) => unknown
250+
[PreviewEmoteEventType.ANIMATION_PLAY]: void
251+
[PreviewEmoteEventType.ANIMATION_PAUSE]: void
252+
[PreviewEmoteEventType.ANIMATION_LOOP]: void
253+
[PreviewEmoteEventType.ANIMATION_END]: void
254+
[PreviewEmoteEventType.ANIMATION_PLAYING]: { length: number }
255255
}
256256

257-
const events = new EventEmitter<Events>()
257+
const events = mitt<Events>()
258258

259259
// Emit the PreviewEmoteEventType.ANIMATION_PLAYING event with the current playing frame
260260
const emitPlayingEvent = () => {

0 commit comments

Comments
 (0)