Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: event emitter that works in browser #267

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3506,6 +3506,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:
rolznz marked this conversation as resolved.
Show resolved Hide resolved
version "1.0.3"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-1.0.3.tgz#c9d2a9c689870f15251bb13b31c67715c26d69ac"
integrity sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==

emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz"
Expand Down
Loading