Skip to content

Commit

Permalink
Add support for Symbol() as event message (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszgachowski authored and mroderick committed Sep 17, 2018
1 parent 8ed94f9 commit c6508f6
Show file tree
Hide file tree
Showing 4 changed files with 1,311 additions and 668 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -182,6 +182,21 @@ PubSub.subscribe(MY_TOPIC, function (msg, data) {
PubSub.publish(MY_TOPIC, 'world');
```

### Example of use of "symbol constants" with ES6/7 syntax

```javascript
// event-types.js
export const MY_TOPIC = Symbol('MY_TOPIC')

// somefile.js
import { MY_TOPIC } from './event-types.js'
PubSub.subscribe(MY_TOPIC, function (msg, data) {
console.log(data)
});

PubSub.publish(MY_TOPIC, 'world');
```

### Immediate Exceptions for stack traces in developer tools

As of version 1.3.2, you can force immediate exceptions (instead of delayed exceptions), which has the benefit of maintaining the stack trace when viewed in dev tools.
Expand Down

0 comments on commit c6508f6

Please sign in to comment.