smoothly-model
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -10,3 +10,2 @@ "use strict"; | ||
static send(message, content, context) { | ||
console.log("message.send", { message, content, context }); | ||
if (Message.is(message) && context == undefined) { | ||
@@ -18,3 +17,2 @@ context = content; | ||
message = { destination: destination[1], content: message.content }; | ||
console.log("postMessage", message, destination[0]); | ||
context.postMessage(message, destination[0]); | ||
@@ -37,3 +35,2 @@ } | ||
(context || window).addEventListener("message", (e) => { | ||
console.log("message.listen callback", origin, { message: e.data, origin: e.origin }); | ||
const message = e.data; | ||
@@ -40,0 +37,0 @@ if (Message.is(message) && (origin == "*" || e.origin == origin) && (destination == "" || message.destination == destination)) |
@@ -14,3 +14,2 @@ export interface Message<T> { | ||
static send(message: string | Message<any>, content?: any | Window, context?: Window): void { | ||
console.log("message.send", { message, content, context }) | ||
if (Message.is(message) && context == undefined) { | ||
@@ -22,3 +21,2 @@ context = content as Window | ||
message = { destination: destination[1], content: message.content } | ||
console.log("postMessage", message, destination[0]) | ||
context.postMessage(message, destination[0]) | ||
@@ -40,3 +38,2 @@ } else if (typeof(context) != "string") { | ||
(context || window).addEventListener("message", (e: MessageEvent) => { | ||
console.log("message.listen callback", origin, { message: e.data, origin: e.origin }) | ||
const message = e.data | ||
@@ -43,0 +40,0 @@ if (Message.is(message) && (origin == "*" || e.origin == origin) && (destination == "" || message.destination == destination)) |
{ | ||
"name": "smoothly-model", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Data models for Smoothly.", | ||
@@ -5,0 +5,0 @@ "author": "PayFunc", |
Sorry, the diff of this file is not supported yet
62478
1185