-
Notifications
You must be signed in to change notification settings - Fork 0
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] Add isConnected API #294
Conversation
@@ -22,10 +23,15 @@ export const request = async <T>( | |||
ainize: Ainize, | |||
{ serviceName, opType, data, timeout = DEFAULT_TIMEOUT_MS }: AinizeRequest | |||
): Promise<AinizeResponse<T>> => { | |||
if (!Handler.getInstance().isConnected()) { | |||
throw new Error('Network error: blockchain event channel is not connected.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
985021c
to
f5a521d
Compare
async open() { | ||
async connect() { | ||
if (this.isConnected()) { | ||
throw new Error('Client is already connected.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
async close() { | ||
async disconnect() { | ||
if (!this.isConnected()) { | ||
throw new Error('Client is not connected.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks!
Thank you for quick review @platfowner! now merging... |
Summary
isConnected
API.open
->connect
,close
->disconnect
API.