Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Milfred committed Feb 27, 2024
2 parents 6594f52 + 213f8d7 commit b081f27
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.4.0](https://github.com/limbo-works/Limbo.Nuxt.Core/compare/v2.3.0...v2.4.0) (2024-02-08)


### Features

* added composable `useEventBus` ([977f02a](https://github.com/limbo-works/Limbo.Nuxt.Core/commit/977f02a8feea15077f899b6859ca8e3be4e2f16f))

## [2.3.0](https://github.com/limbo-works/Limbo.Nuxt.Core/compare/v2.2.2...v2.3.0) (2024-02-05)


Expand Down
15 changes: 15 additions & 0 deletions composables/useEventBus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function useEventBus() {
const app = useNuxtApp();

return {
on(event, callback) {
if (typeof callback === 'function') {
app.hook(`limbo:${event}`, callback);
}
},

emit(event, data) {
app.hooks.callHook(`limbo:${event}`, data);
},
};
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@limbo-works/nuxt-core",
"type": "module",
"version": "2.3.0",
"version": "2.4.0",
"main": "./nuxt.config.js",
"scripts": {
"dev": "nuxi prepare & nuxi dev .playground",
Expand Down

0 comments on commit b081f27

Please sign in to comment.