Skip to content

Commit

Permalink
Merge pull request #267 from getAlby/emittery
Browse files Browse the repository at this point in the history
feat: event emitter that works in browser
  • Loading branch information
pavanjoshi914 authored Nov 29, 2024
2 parents ee07a4c + 6ce1d98 commit 316fca4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"prepare": "husky install"
},
"dependencies": {
"eventemitter3": "^5.0.1",
"emittery": "^1.0.3",
"nostr-tools": "^1.17.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/OAuth2User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
GenerateAuthUrlOptions,
} from "./types";
import { RequestOptions, rest } from "./request";
import EventEmitter from "eventemitter3";
import Emittery from "emittery";

const AUTHORIZE_URL = "https://getalby.com/oauth";

Expand Down Expand Up @@ -50,10 +50,10 @@ export class OAuth2User implements OAuthClient {
code_verifier?: string;
code_challenge?: string;
private _refreshAccessTokenPromise: Promise<{ token: Token }> | null;
private _tokenEvents: EventEmitter;
private _tokenEvents: Emittery;

constructor(options: OAuth2UserOptions) {
this._tokenEvents = new EventEmitter();
this._tokenEvents = new Emittery();
const { token, ...defaultOptions } = options;
this.options = { client_secret: "", ...defaultOptions };
this.token = token;
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3549,6 +3549,11 @@ emittery@^0.13.1:
resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz"
integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==

emittery@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-1.0.3.tgz#c9d2a9c689870f15251bb13b31c67715c26d69ac"
integrity sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==

emoji-regex@^10.3.0:
version "10.4.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.4.0.tgz#03553afea80b3975749cfcb36f776ca268e413d4"
Expand Down

0 comments on commit 316fca4

Please sign in to comment.