What is the best way to use Web Component

Hello,

I wonder about Web Component… What is the best to use Web Component more than 1?

Lets say, i want to call many link using Web Component… if i have 3 web link to call… so i use 3 web component

Web1 URL and GET Link A, Web2 URL and GET Link B, Web3 URL and GET. and Link C

There is other solution by using just 1 Web Component? just like

Web1 URL Link A and GET Link A, then after that use Web1 URL Link B and GET Link B etc.

Thank you for your help

No one component is okay.
Create global variable named current_request.
Before calling any api or url just set this variable its name like making call for images then set this to images and on event of webcomponent check this via if else statement like
If current_variable === images
Then do this
Else if current_variable === something
Then do this

2 Likes

Like this -
blocks
blocks (7)
blocks (2)
blocks (3)
blocks (4)

2 Likes

the alternative solution is to use 3 web components
Taifun

Thank all, for reply and wonderful information…

What i got from @ShaikhSajidAli (@ADDYLIN) and @Taifun have same result… are im correct?

Thanks

yes
Taifun

1 Like

Thanks all, you can close this topic… thanks for help

Mark my answer as solution to close topic

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.