Skip to content

Commit

Permalink
5.1.0 (#62)
Browse files Browse the repository at this point in the history
* Version++
gitignore yarn.lock

* Separate out net request implementations

* Updated exceptionals to have unit tests and rename a few parameters to make more sense

* Extra immediate unit tests

* Added parallel() / series()
Fixed issue in mache.data
More unit tests

* Various documentation updates
  • Loading branch information
KrisSiegel authored Dec 12, 2016
1 parent 243c27b commit e2a43e1
Show file tree
Hide file tree
Showing 21 changed files with 570 additions and 290 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ node_modules
# msngr.js specific
test/specRunner.html
test/specRunner.min.html
yarn.lock
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: node_js
sudo: false
node_js:
- "7.2"
- "6.9"
- "6.7"
- "6.4"
- "6.3.1"
- "6.2"
Expand All @@ -10,6 +13,7 @@ node_js:
- "5.7"
- "5.1"
- "5.0"
- "4.6"
- "4.5"
- "4.2"
- "4.1"
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Changelog
This is a roll-up of all release notes in order of release

## [Release 5.1.0 - December 11, 2016](https://github.com/KrisSiegel/msngr.js/releases/tag/5.1.0)
Version 5.1.0 brings some minor improvements and changes

***What's new?***
- Added ```msngr.parallel()``` and ```msngr.series()```. These are handy for asynchronous patterns and already existed, internally, to msngr.js. This simply exposes them but in a more simplified way.

***Misc changes***
- ```msngr.is(Promise)``` should now work in cases where Promise is pollyfilled.
- Fixed issue in mache where calling ```.data``` property would set a transaction to the baseline dataset

## [Release 5.0.1 - August 28, 2016](https://github.com/KrisSiegel/msngr.js/releases/tag/5.0.1)
Minor updates to documentation to include better msngr.js logo placement, simex logo and simex sponsorship.

Expand Down
57 changes: 49 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,31 @@ Reference msngr directly [from cdnjs](https://cdnjs.com/libraries/msngr)

### Hello, World!
```javascript
msngr("SayIt").on(function (words) {
console.log(words); // Outputs 'Hello, World!'
// I can call a function when I receive a specific message!
msngr("Output").on(function (words) {
console.log(words); // Outputs 'Hello, World!', 'I'm chainable!' and 'Weee'
});

msngr("SayIt").emit("Hello, World!");
// I can emit messages of any type. I can even chain almost anything.
msngr("Output")
.emit("Hello, World!")
.emit("I'm chainable!")
.emit("Weee");

// I can emit and persist a message, too so future handlers can receive it
msngr("Important", "Message").persist("I am persisted!");

// See?
msngr("Important", "Message").on(function (text) {
console.log(text); // Outputs 'I am persisted!'
});

// I can even guarantee a handler is called once
msngr("Once").once(function (str) {
console.log(str); // Only outputs 'Just once'
});

msngr("Once").emit("Just once").emit("asdljadlka").emit("sadjkhada");
```

### Anatomy of a message
Expand Down Expand Up @@ -151,13 +171,34 @@ msngr.immediate(function () {

```

### Sponsor
<p>
<img src="https://github.com/KrisSiegel/msngr.js/raw/master/resources/simex-logo.png" alt="msngr.js logo" title="msngr.js logo" align="right" />
### msngr.parallel(methods, callback) / msngr.series(methods, callback)
Handling asynchronous behaviors can be difficult and there are many libraries (async.js) and techniques (promises, async & await) for handling such issues. But sometimes you just need a simple way to take multiple methods and combine them. Msngr uses this capability internally for handling message delegation and processing of middleware so these two methods are the public version of the very same API.

msngr.js development is sponsored by <a href="https://www.simex.io/">Simex</a>, an aspiring start-up looking to make a dent in artificial intelligence and data aggregation. Follow <a href="https://twitter.com/heysimex">@HeySimex</a> on Twitter!</p>
```javascript
var props = { };
msngr.parallel([
function () { props.value1 = 42; },
function () { props.value2 = "forty two"; },
function () { props.value3 = true; },
], function () {
console.log(props.value1); // Prints 42
console.log(props.value2); // Prints 'forty two'
console.log(props.value3); // Prints true
});

msngr.series([
function () { return "s" },
function () { return "e" },
function (async) { async()("r") },
function (async) { async()("i") },
function (async) { async()("e") },
function () { return "s" }
], function (results) {
console.log(results.join("")); // Prints "series"
});
```

#### Contact
For questions, news, and whatever else that doesn't fit in GitHub issues you can follow me [@KrisSiegel](https://twitter.com/KrisSiegel)
For questions, news, and whatever else that doesn't fit in GitHub issues you can follow me [@BinaryIdiot](https://twitter.com/BinaryIdiot)

Copyright © 2014-2016 Kris Siegel
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "msngr.js",
"main": "msngr.min.js",
"description": "msngr.js is an asynchronous messaging library, written in JavaScript, for node and browser use",
"version": "5.0.1",
"version": "5.1.0",
"homepage": "https://github.com/KrisSiegel/msngr.js",
"authors": [
"Kris Siegel"
Expand Down
Loading

0 comments on commit e2a43e1

Please sign in to comment.