Comparing version 2.11.3 to 2.12.0-0
{ | ||
"name": "ralltiir", | ||
"version": "2.11.3", | ||
"version": "2.12.0-0", | ||
"discription": "前端极速浏览框架,目标是提升用户体验,提供沉浸式浏览方式。", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -20,4 +20,9 @@ # Ralltiir | ||
推荐通过 APM 安装和使用 ralltiir。 | ||
```bash | ||
npm install -g ralltiir | ||
# 安装 apm | ||
npm install -g apmjs | ||
# 安装 ralltiir | ||
apmjs install --save ralltiir | ||
``` | ||
@@ -24,0 +29,0 @@ |
@@ -26,2 +26,3 @@ /** | ||
register: register, | ||
postMessage: postMessage, | ||
unRegister: unRegister, | ||
@@ -68,2 +69,16 @@ isRegistered: isRegistered, | ||
function postMessage(msg, target) { | ||
assert(target, 'message target should be set explicitly'); | ||
serviceInstances.forEach(function (service) { | ||
if (!_.isFunction(service.onMessage)) { | ||
return; | ||
} | ||
if (target === '*' || target === service.name) { | ||
setTimeout(function () { | ||
service.onMessage(msg); | ||
}); | ||
} | ||
}); | ||
} | ||
function isRegistered(pathPattern) { | ||
@@ -70,0 +85,0 @@ return urlEntries.has(pathPattern); |
@@ -149,2 +149,13 @@ /** | ||
/** | ||
* Traverse all items available | ||
* | ||
* @param {Function} cb(value, key) The callback to iterate with | ||
*/ | ||
forEach: function (cb) { | ||
this.list.forEach(function (item) { | ||
cb(item.value, item.key); | ||
}); | ||
}, | ||
size: function () { | ||
@@ -151,0 +162,0 @@ return this.list.length; |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
164276
3941
90
2