You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I`m struggling to make it work with a nuxt3 project (static , ssr:false).
Basically it DOES emit the events, but it's harder to receive them.
I added this in: current component , sub-component, sub-sub-component emitter.on('*', () => { alert(1)});
And only the one in the current component is triggered. Don't seem to be able to go cross-components. Might be because of how nuxt encapsulates the components _ .. but currently I have no easy solution for "global" events..
The text was updated successfully, but these errors were encountered:
Then in your components sendEvent and useListen are just available.
Example of sendEvent in Component <script setup lang="ts"> sendEvent('application:log',{ severity: 'Critical', message: 'Oh No It Failed'}) </script>
Example of useListen in Component <script setup lang="ts"> useListen('application:log', async (logMessage) =>{ // Do something with logMessage like send to a northbound server log. await postToServer( 'LogMessage' , logMessage.severity , logMessage.message ); }; </script>
I`m struggling to make it work with a nuxt3 project (static , ssr:false).
Basically it DOES emit the events, but it's harder to receive them.
I added this in: current component , sub-component, sub-sub-component
emitter.on('*', () => { alert(1)});
And only the one in the current component is triggered. Don't seem to be able to go cross-components. Might be because of how nuxt encapsulates the components
_.. but currently I have no easy solution for "global" events..The text was updated successfully, but these errors were encountered: