feat: Add a popout option on webwidget (#1174)
* feat: Add a popout option on webwidget
This commit is contained in:
parent
ce13efd273
commit
45cd949c40
17 changed files with 347 additions and 127 deletions
|
@ -1,3 +1,5 @@
|
|||
import { WOOT_PREFIX } from './constants';
|
||||
|
||||
export const isEmptyObject = obj =>
|
||||
Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||
|
||||
|
@ -16,4 +18,11 @@ export const IFrameHelper = {
|
|||
'*'
|
||||
);
|
||||
},
|
||||
isAValidEvent: e => {
|
||||
const isDataAString = typeof e.data === 'string';
|
||||
const isAValidWootEvent =
|
||||
isDataAString && e.data.indexOf(WOOT_PREFIX) === 0;
|
||||
return isAValidWootEvent;
|
||||
},
|
||||
getMessage: e => JSON.parse(e.data.replace(WOOT_PREFIX, '')),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue