marblejs / marble

Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
https://marblejs.com
MIT License
2.15k stars 71 forks source link

Wrong warning message about eventBus & eventBusClient binding order #373

Closed wyrd-code closed 2 years ago

wyrd-code commented 2 years ago

Describe the bug

EventBusClient shows the wrong warning when it's binding order is not correct:

[eventBusClient] - "EventBusClient" requires to be registered eagerly before main "EventBus" reader.

It seems to be the other way around, according to this pull req where it says:

@marblejs/messaging - restricted binding order for event bus and its corresponding client - first eventBus reader then eventBusClient.

To Reproduce

await createServer({
      listener: httpListener({
        effects: this.effects,
      }),
      dependencies: [
        bindEagerlyTo(EventBusClientToken)(eventBusClient),
        bindEagerlyTo(EventBusToken)(eventBus({ listener: eventBusListener })),
      ],
    })

Expected behavior

The message should say something like

[eventBusClient] - the main "EventBus" reader must be registered eagerly before "EventBusClient".

Other notes

Thank you for the hard work on this framework. It's absolutely amazing. I've been looking for something like this for a while. It's a pleasure to learn, play with and even read the docs. :)

JozefFlakus commented 2 years ago

Oh! Thanks for spotting it! 🙌

JozefFlakus commented 2 years ago

Fixed in version v4.0.0-rc.3