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

LIQ-732: POC websocket client #375

Merged
merged 1 commit into from
Oct 3, 2022
Merged

LIQ-732: POC websocket client #375

merged 1 commit into from
Oct 3, 2022

Conversation

vanminh1701
Copy link
Contributor

No description provided.

@vanminh1701 vanminh1701 marked this pull request as draft August 26, 2022 02:43
@vanminh1701 vanminh1701 changed the title Poc/websocket LIQ-732: POC websocket client Aug 31, 2022
example/constant/formConfiguration.ts Outdated Show resolved Hide resolved
core/ui/src/constant/SocketEvent.ts Outdated Show resolved Hide resolved
@vanminh1701 vanminh1701 force-pushed the poc/websocket branch 2 times, most recently from 0530304 to a346192 Compare September 15, 2022 10:47
@vanminh1701 vanminh1701 marked this pull request as ready for review September 15, 2022 10:47
core/ui/src/constant/SocketEvent.ts Outdated Show resolved Hide resolved
core/ui/src/public/Context/Socket.tsx Outdated Show resolved Hide resolved
core/ui/src/public/Orders/index.tsx Outdated Show resolved Hide resolved
@@ -104,6 +109,22 @@ export const Drops: React.FC<DropsProps> = ({ candyShop, wallet, walletConnectCo
});
};

// socket
useEffect(() => {
const controllers = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, we declare the controllers here, wouldn't the reference will be changed every time once component renders, so the purpose here is we need to add the listeners and clean the listeners every time when component is being mounting / unmounting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, removeControllers will be run every time useEffect re-run. If we dont remove controllers at that time, the listeners are stil there and we will have more than 1 listeners for 1 event, the result maybe we will add duplicate item to list and display on UI, or some unexpected results. So better just clean it every useEffect re-run or unmount phase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, that sounds good and it's the desired result we want to avoid heap grows.

socket auction

integrate auction, order, drop

remove polling code

remove unused code

upadte comment

update env websocket

add socket url and trade event for sell
@haVincy
Copy link
Contributor

haVincy commented Sep 29, 2022

@vanminh1701 vanminh1701 merged commit 6de5003 into master Oct 3, 2022
@haVincy haVincy deleted the poc/websocket branch October 8, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants