Get started with postal.js CDN
MIT licensed
Postal.js is a publish-subscribe messaging library for the browser.
Tags:- pub/sub
- pub
- sub
- messaging
- message
- bus
- event
- mediator
- broker
- envelope
Stable version
Copied!
How to start using postal.js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with postal.js CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/postal.js/2.0.6/postal.min.js"></script>
</head>
<body>
<script>
// Initialize Postal.js
const bus = new Postal();
// Define a channel
bus.channel('myChannel');
// Publish a message on the channel
bus.channel('myChannel').publish({ type: 'myMessageType', data: 'Hello, Postal.js!' });
// Subscribe to the channel and handle messages
bus.channel('myChannel').subscribe({
'myMessageType': function(message) {
console.log('Received message:', message.data);
}
});
</script>
</body>
</html>
Copied!
Copied!
All versions
0.10.0
0.10.1
0.10.2
0.10.3
0.11.0
0.11.1
0.11.2
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.7.3
0.8.0
0.8.1
0.8.10
0.8.11
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
0.8.7
0.8.8
0.8.9
0.9.0
0.9.0-rc1
0.9.0-rc3
0.9.1
1.0.0
1.0.1
1.0.10
1.0.11
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
*** 2.0.6