-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
<p align="center"> | ||
<h1>🍀 Irish PubSub - 133b pubsub system</h1> | ||
<h1>🍀 Irish PubSub - 97b pubsub system</h1> | ||
<br> | ||
<a href="https://www.npmjs.org/package/irish-pub-sub"><a href="https://unpkg.com/irish-pub-sub/dist/index.min.umd.js"><img src="http://img.badgesize.io/https://unpkg.com/irish-pub-sub/dist/index.min.js?compression=gzip" alt="gzip size"></a> <a href="https://packagephobia.now.sh/result?p=irish-pub-sub"><img src="https://packagephobia.now.sh/badge?p=irish-pub-sub" alt="install size"></a> | ||
<a href="https://unpkg.com/irish-pub-sub/dist/index.min.umd.js"> | ||
<img src="http://img.badgesize.io/https://unpkg.com/[email protected]/dist/index.min.js?compression=gzip" alt="gzip size"> | ||
</a> | ||
<a href="https://unpkg.com/irish-pub-sub/dist/index.min.umd.js"> | ||
<img src="http://img.badgesize.io/https://unpkg.com/[email protected]/dist/index.min.js?compression=brotli" alt="brotli size"> | ||
</a> | ||
<a href="https://packagephobia.now.sh/result?p=irish-pub-sub"> | ||
<img src="https://packagephobia.now.sh/badge?p=irish-pub-sub" alt="install size"> | ||
</a> | ||
</p> | ||
|
||
|
||
Modern (es6) functional Pubsub system (no `class`, or `this`), weights about 133b minified + gzipped. | ||
Modern (es6) functional Pubsub system (no `class`, or `this`), weights about 97b minified + gzipped. | ||
|
||
<h2>Install</h2> | ||
|
||
|
@@ -22,8 +30,9 @@ import pubsub from 'irish-pub-sub' | |
|
||
const [subscribe, send] = pubsub() | ||
|
||
const unsbuscribe = subscribe('The Dreadnoughts', (val) => console.log('The Dreadnoughts: ', val)) // returns unsubscribe method | ||
const unsubscribe = subscribe('The Dreadnoughts', (val) => console.log('The Dreadnoughts: ', val)) // returns unsubscribe method | ||
send('Dreadnoughts', 'Best band ever') // => The Dreadnoughts: Best band ever | ||
unsubscribe() // => true | ||
``` | ||
|
||
_Inspired by [developit/mitt](https://github.com/developit/mitt)_ | ||
|