Skip to main content

Reactive actions in Fireback

On of the areas that Fireback shines is Reactive actions. It might be useful to read Fireback Actions first, if you are not familar with them.

Meaning of 'reactive' method

Most of the APIs in a backend system are often common http requests, such as post, get, delete and so on. A lot of time there is not a good definition of socket connection for endpoint, or goes through weird architectures such as socket.io framework.

Fireback, introduces a new http method in Module3 yaml definition, which is 'reactive'. When a action is defined as reactive, front-end can call that endpoint as a socket connection, and read/write operation can be done automatically. You can connect from JavaScript side to reactive endpoint using new WebSocket class, also fireback react sdk generates some hooks to interact with them.

Difference in reactive method

Reactive actions are very similar to http actions, just the function generated for them is using chan or goroutines in golang. There will be 2 channels created, one for getting