Mayhem50
Mayhem50

Reputation: 431

Having multiple tabs open but only one communicates with the server

Looking for some advice for having multiple tabs open in a single browser but only one communicates with the server.

Best practices, frameworks etc.

figured there might be a framework that already handles this idea through local storage or cookies but couldn't seem google one or find a previous post that addresses this problem.

At this point i'm looking to role my own via by keeping a list of tabs and assigning one to make calls to the server and share the data via local storage.

update. found this Duel.js will investigate.

Upvotes: 4

Views: 140

Answers (1)

Mayhem50
Mayhem50

Reputation: 431

Alright after some playing around with DuelJS it appears to be what I was looking for in terms of a existing API.

Managed to get it working in within a Angular 2 typescript project and I'm pretty happy with the result.

Basically I have single web page open in two tabs one being a master tab that is making all the calls to the server/database and broadcasting the result the slave tab where the component/view is updated.

Still interested in other peoples thoughts?

Upvotes: 1

Related Questions