mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 12:23:45 +08:00
Docs & stuff
This commit is contained in:
@@ -48,7 +48,7 @@ if (!window.opener) {
|
||||
|
||||
// Pass any events through our parent.
|
||||
eventEmitter.onAny((eventName, value) => {
|
||||
pym.sendMessage('eventEmitter', JSON.stringify({eventName, value}));
|
||||
pym.sendMessage('event', JSON.stringify({eventName, value}));
|
||||
});
|
||||
|
||||
// Add a redux listener to pass through all actions to our event emitter.
|
||||
|
||||
@@ -174,7 +174,8 @@ function configurePymParent(pymParent, opts) {
|
||||
window.open(url, '_blank').focus();
|
||||
});
|
||||
|
||||
pymParent.onMessage('eventEmitter', (raw) => {
|
||||
// Pass events from iframe to the event emitter
|
||||
pymParent.onMessage('event', (raw) => {
|
||||
const {eventName, value} = JSON.parse(raw);
|
||||
eventEmitter.emit(eventName, value);
|
||||
});
|
||||
|
||||
@@ -11,6 +11,10 @@ export function injectReducers(reducers) {
|
||||
store.replaceReducer(combineReducers(store.coralReducers));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a action listener to the redux store.
|
||||
* The action is passed as the first argument to the callback.
|
||||
*/
|
||||
export function addListener(cb) {
|
||||
listeners.push(cb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user