Skip to content

"Are the emitters asynchronous?" #26

@timsim00

Description

@timsim00
No. If you're interested in doing that, use something like nanotick to batch events and ensure they run asynchronously.

I'm probably misunderstanding something here, but I have a timing issue that sure seems async when calling emitter.emit.

module.exports = function view (state, emit, props = {}) {
  var id = state.params.msgId
  // emit('autopilot:edit-message', id)
  let {item} = state.autopilot.findItemById(id)
  state.autopilot.current = item

The listener for 'edit-message' only has the two lines that follow //emit... Calling emit instead of the two lines results in an error downstream because state.autopilot.current isn't set yet.

Metadata

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