enhanced-datachannel
Advanced tools
Comparing version 1.2.1 to 1.2.2
# ChangeLlog | ||
## [1.2.2] - 2019-07-29 | ||
### Changed | ||
- Fix README texts. | ||
- Allow `resolve()` at `on("message", data, resolve, reject)`. | ||
## [1.2.1] - 2019-07-23 | ||
@@ -7,3 +14,3 @@ | ||
- Do not strict typing JSON argument | ||
- Do not strict typing JSON argument. | ||
@@ -14,3 +21,3 @@ ## [1.2.0] - 2019-07-22 | ||
- Add typings for an instance | ||
- Add typings for an enhanced instance. | ||
@@ -41,2 +48,3 @@ ## [1.1.1] - 2019-07-18 | ||
[1.2.2]: https://github.com/leader22/enhanced-datachannel/releases/tag/v1.2.2 | ||
[1.2.1]: https://github.com/leader22/enhanced-datachannel/releases/tag/v1.2.1 | ||
@@ -43,0 +51,0 @@ [1.2.0]: https://github.com/leader22/enhanced-datachannel/releases/tag/v1.2.0 |
{ | ||
"name": "enhanced-datachannel", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Wanna `enhance(RTCDataChannel)` for general usage.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# enhanced-datachannel | ||
Wanna `enhance(RTCDataChannel)` for general usage. | ||
The `enhance(RTCDataChannel)` functions for general usage. | ||
@@ -11,3 +11,3 @@ ## Install | ||
You need to bundle it into your app. | ||
You need to bundle into your app using `webpack`, `rollup`, etc.... | ||
@@ -38,3 +38,3 @@ ## Exports | ||
Passed instance should be `reliable` and `ordered` mode. | ||
Passed `RTCDataChannel` instance should be `reliable` and `ordered` mode. | ||
@@ -88,3 +88,3 @@ ## API | ||
But this class has special `send()` method and `on("message")` handler. | ||
And this class has special `send()` method and `on("message")` handler. | ||
@@ -95,4 +95,4 @@ ```js | ||
try { | ||
console.log(data); // "Take this!" | ||
resolve("Thank you!"); | ||
console.log(data.msg); // "Take this!" | ||
resolve({ res: "Thank you!" }); | ||
} catch (err) { | ||
@@ -104,4 +104,4 @@ reject(err); | ||
// send | ||
const res = await promisedDC.send("Take this!"); | ||
console.log(res); // "Thank you!" | ||
const data = await promisedDC.send({ msg: "Take this!" }); | ||
console.log(data.res); // "Thank you!" | ||
``` | ||
@@ -121,3 +121,3 @@ | ||
But this class has special `send()` method and `on("message")` handler. | ||
And this class has special `send()` method and `on("message")` handler. | ||
@@ -124,0 +124,0 @@ ```js |
22164