mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 18:41:06 +08:00
CLEANUP after bad merge after removal of peerListener
This commit is contained in:
parent
5b1d3e54a8
commit
1192b729ff
@ -5,7 +5,7 @@ import { ModuleFn } from '../index';
|
||||
|
||||
export interface SubAPI {
|
||||
getChannel: () => Channel;
|
||||
on: (type: string, cb: Listener, peer?: boolean) => () => void;
|
||||
on: (type: string, cb: Listener) => () => void;
|
||||
off: (type: string, cb: Listener) => void;
|
||||
emit: (type: string, ...args: any[]) => void;
|
||||
once: (type: string, cb: Listener) => void;
|
||||
@ -16,12 +16,8 @@ export interface SubAPI {
|
||||
export const init: ModuleFn = ({ provider }) => {
|
||||
const api: SubAPI = {
|
||||
getChannel: () => provider.channel,
|
||||
on: (type, cb, peer = true) => {
|
||||
if (peer) {
|
||||
provider.channel.addPeerListener(type, cb);
|
||||
} else {
|
||||
provider.channel.addListener(type, cb);
|
||||
}
|
||||
on: (type, cb) => {
|
||||
provider.channel.addListener(type, cb);
|
||||
|
||||
return () => provider.channel.removeListener(type, cb);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user