Skip to content

Commit

Permalink
update readme and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jd1378 committed Mar 22, 2021
1 parent 04185aa commit 0ce0bfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# Changelog

## v0.2.0

- use EVT instead of event emitter, which enforces type safety.

## v0.1.4

- updated another_cookiejar to v4.0.0
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Till stable v1.0.0 release, patch versions may contain a new feature or a fix, m
## Example Usage

```ts
import { createTradeManager, ETradeOfferState, TradeOffer } from "./mod.ts";
import { createTradeManager, ETradeOfferState, TradeOffer, to } from "./mod.ts";

const tradeManager = await createTradeManager({
language: "en",
Expand All @@ -36,19 +36,19 @@ const tradeManager = await createTradeManager({
// it is `false` by default because it does extra requests unnecessarily for some use cases.
}, console.log);

tradeManager.on("unknownOfferSent", (offer: TradeOffer) => {
tradeManager.evt.$attach(to("unknownOfferSent"), (offer) => {
console.log("unknownOfferSent: ", offer.id);
});

tradeManager.on("sentOfferChanged", (offer: TradeOffer) => {
tradeManager.evt.$attach(to("sentOfferChanged"), ([offer, offerState]) => {
console.log("sentOfferChanged: ", offer.id);
});

tradeManager.on("receivedOfferChanged", (offer: TradeOffer) => {
tradeManager.evt.$attach(to("receivedOfferChanged"), ([offer, offerState]) => {
console.log("receivedOfferChanged: ", offer.id);
});

tradeManager.on("newOffer", (offer: TradeOffer) => {
tradeManager.evt.$attach(to("newOffer"), (offer) => {
console.log(
"newOffer: ",
offer.id,
Expand Down

0 comments on commit 0ce0bfa

Please sign in to comment.