question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow for namespacing or nesting of events

See original GitHub issue

It is really nice that I can nest my actions in a mixin, like

actions: {
  auth: {
      login: () => {}
   }
}

But if I have an event in the same mixin, I can’t do the same. Would it be worth making something like emit(‘auth.expired’) possible? I realize this is a minor convenience and would definitely not be in favour unless it is not too complicated to do.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
FlorianWendelborncommented, Aug 20, 2017

As long as emit is called with a string, I disagree with the proposal. It’s needlessly complex and won’t help a lot since it only solves half of the problem.

In case we decide to change that to a more action-like API (e.g. app.events.example.event()), I’d suggest merging events, and actions if possible or implement this feature request.

1reaction
Swizzcommented, Aug 20, 2017

Events act like reducers accross Mixins and App. So, I tried some things, but even if this is easy to split the event name to obtain a key river "foo:bar:baz ==> appEvents[foo][bar][baz], I dont know if this feature would be easy to reason about.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can namespaces be nested in C++? - GeeksforGeeks
In C++, namespaces can be nested, and resolution of namespace variables is hierarchical. For example, in the following code, namespace inner ...
Read more >
How do you Declare Namespace in JavaScript? - Scaler Topics
Allows us to model different relationships using nested namespaces. Prevents memory leakage due to accidental global variables.
Read more >
Essential JavaScript Namespacing Patterns - Addy Osmani
In JavaScript Patterns, Stoyan Stefanov presents a very-clever approach for automatically defining nested namespaces under an existing ...
Read more >
Nesting JS namespaces - javascript - Stack Overflow
I am trying to using some sort of namespace ...
Read more >
Namespaces (C++) - Microsoft Learn
The using directive allows all the names in a namespace to be used without the namespace-name as an explicit qualifier. Use a using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found