browser-communication
v1.0.2
Published
browser communication between tabs using localStorage
Downloads
4
Maintainers
Readme
browser-communication
This is a helper for communicating two or more browser tabs.
usage
There is two functions exported that you can use;
import { Data, fromStorage, publishStorage } from 'browser-communication';
interface User extends Data {
id: number;
username: string;
}
fromStorage<User>('user').subscribe(user => {
// when someone calls publishStorage this
// this callback will be executed
// local publishes are included though
});
publishStorage('user', {
id: 3,
username: 'john_doe'
});