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

Check of user logged all over the code #235

Open
regnarock opened this issue Sep 29, 2014 · 2 comments
Open

Check of user logged all over the code #235

regnarock opened this issue Sep 29, 2014 · 2 comments

Comments

@regnarock
Copy link
Member

There is currently no abstraction about the user and logging system, thus many modules that depends on it have to write lines like:

var user = Beluga.getInstance().getModuleInstance(Account).loggedUser

if (user != null) {
     \\do something
} else {
    \\handle it, more often that not by raising a typical trigger like following
    this.triggers.actionFail.dispatch({error : MissingLogin});
}

This is quite a hassle and looks like a bad design.

@ValentinTrinque
Copy link
Member

I agree.

@brissa-a
Copy link
Contributor

brissa-a commented Nov 1, 2014

There is some great things with the web dispatcher for this:
http://old.haxe.org/manual/dispatch#metadata-handling

@regnarock regnarock self-assigned this Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants