- Rewrote the whole library in TypeScript to finally fix all the type issues.
Breaking Changes
- Stop publishing UMD modules
- Fix behavior of
publish
'sasync
option. The option will now override the globally specified behavior. - Fix a typo in
types
ofpackage.json
to point to the correct type definitions - Further improve some type descriptions
- Fix several type definitions
- Add and publish types
- Add missing
clear()
function to the global pub sub instance
- Fix an issue with the Broadcast Channel's
publish
call
- Fix an edge case in async
publish
- Add option to make the event stack case-insensitive via
createPubSub({ caseInsensitive: true })
- Add option to make
publish
asynchronous viacreatePubSub({ async: true })
(orpubSub.publish(event, news, { async: true })
)
Breaking Changes
- The API of
createPubSub
changed fromcreatePubSub(customStackObject = {})
tocreatePubSub({ async = false, caseInsensitive = false, stack = {} } = {})
- Fix a bug when using pub-sub-es in an iframe.
- Updated third-party packages
- Fixed a bad bug when subscribing with the shorthand. Expanded the tests to cover the shorthand unsubscription.
- Add
clear()
for removing all currently active event listeners and unsetting all event times
- Check if
BroadcastChannel
is available and log a warning otherwise
- Catch exceptions on broadcasting with
BroadcastChannel
- Expand global communication across windows
- Add a demo page
- Prettify code and fix doc typos
- Make sure that custom stacks have the
__times__
property
- Fully tested working version