Skip to content

Query DB on Event::listen #30

Open
@Kiszko

Description

Firstly, and unrelated - when I console log a msg I get 2 logs, eg.

app.BrainSocket.Event.listen('some.event', function(msg)
{
    console.log(msg);
});

returns 2 objects in console when the event if fired - surely it should just return 1.

Secondly, is it possible to query the session or even the db in the Event::listen handler? eg.

Event::listen('some.event', function($client_data)
{
    // Query db - User::find(1)
    return BrainSocket::message('some.event', ['message' => 'foooozer']);
});

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions