Amplify.js pub / sub Synchronous or asynchronous?

Are amplify.js pub / helper events implemented as synchronous or asynchronous?

http://amplifyjs.com/api/pubsub/

The documentation mentions priorities ...

+4
source share
2 answers

The publication is synchronous; priorities and synchronization are not really related.

+5
source

It is synchronous.

Subscription callbacks are called from an implementation of the .publish() method. There is no setTimeout() code.

As for priorities, priority determines where to enter the callback on the callback stack. This logic is processed in .subscribe() . The .publish() method simply performs callbacks in stack order, as previously defined by the .subscribe() method.

+4
source

Source: https://habr.com/ru/post/1386582/


All Articles