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

Chore(Vue3): Migrate to mitt #11996

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Conversation

DorraJaouad
Copy link
Contributor

@DorraJaouad DorraJaouad commented Apr 3, 2024

Part of #9448

  • Replace EventBus with mitt.
  • As mitt emitter doesn't have once method, the latter was replaced like :
const handler = () => {
	function()
	emitter.off('event', handler)
}

emitter.on('event', handler) 

🖌️ UI Checklist

🖼️ Screenshots / Screencasts

no visual changes

🏁 Checklist

  • 🌏 Tested with Chrome, Firefox and Safari or should not be risky to browser differences
  • 🖥️ Tested with Desktop client or should not be risky for it
  • 🖌️ Design was reviewed, approved or inspired by the design team
  • ⛑️ Tests are included or not possible
  • 📗 User documentation in https://github.com/nextcloud/documentation/tree/master/user_manual/talk has been updated or is not required

Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
@DorraJaouad DorraJaouad added this to the 💙 Next Major (30) milestone Apr 3, 2024
@DorraJaouad DorraJaouad requested a review from ShGKme April 3, 2024 14:51
@DorraJaouad DorraJaouad self-assigned this Apr 3, 2024
@DorraJaouad DorraJaouad mentioned this pull request Apr 3, 2024
47 tasks
src/services/emitter.js Outdated Show resolved Hide resolved
@ShGKme
Copy link
Contributor

ShGKme commented Apr 3, 2024

  • As mitt emitter doesn't have once method, the latter was replaced like :

Or we can add a new method to the event bus aka

const EventBus = mitt()
EventBus.once = function(type, handler) {
  this.on(type, ...)
}

@DorraJaouad DorraJaouad force-pushed the chore/noid/event-bus-migration branch from c01d84d to c89e30b Compare April 4, 2024 09:45
src/components/LeftSidebar/LeftSidebar.spec.js Outdated Show resolved Hide resolved
src/store/participantsStore.spec.js Outdated Show resolved Hide resolved
src/store/participantsStore.js Outdated Show resolved Hide resolved
src/components/LeftSidebar/LeftSidebar.vue Outdated Show resolved Hide resolved
src/services/EventBus.js Outdated Show resolved Hide resolved
src/services/EventBus.js Outdated Show resolved Hide resolved
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
@DorraJaouad DorraJaouad force-pushed the chore/noid/event-bus-migration branch from c89e30b to d89d6f2 Compare April 4, 2024 12:34
@DorraJaouad DorraJaouad merged commit 3816ee7 into main Apr 4, 2024
46 checks passed
@DorraJaouad DorraJaouad deleted the chore/noid/event-bus-migration branch April 4, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants