We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
主应用通过这两种方式给微应用传递消息: import { store as starkDataStore, event } from '@ice/stark-data';
event?.emit(MQTT_MESSAGE, { topic, message: JSON.parse(message.toString()) }); starkDataStore?.set(MQTT_MESSAGE, { topic, message: JSON.parse(message.toString()) });
在微应用中:
starkEvent.on(MQTT_MESSAGE, ({ topic, message }) => { console.log('航班动态 收到主应用推送过来的消息', topic, message); onReceivedMqttMessage({ topic, message }); }); starkEvent.off(MQTT_MESSAGE, () => { console.log('航班动态 主应用推送过来的消息监听被移除'); });
starkEvent.off没起作用,反复执行starkEvent.on,主应用发送一次消息,会多次进入starkEvent.on的回调方法
starkEvent.off(MQTT_MESSAGE, () => { console.log('航班动态 主应用推送过来的消息监听被移除'); }); 能够正常取消监听
No response
"@ice/app": "3.4.10"
The text was updated successfully, but these errors were encountered:
可以提供完整的复现 demo,方便排查
Sorry, something went wrong.
No branches or pull requests
Describe the bug
主应用通过这两种方式给微应用传递消息:
import { store as starkDataStore, event } from '@ice/stark-data';
event?.emit(MQTT_MESSAGE, { topic, message: JSON.parse(message.toString()) });
starkDataStore?.set(MQTT_MESSAGE, { topic, message: JSON.parse(message.toString()) });
在微应用中:
starkEvent.off没起作用,反复执行starkEvent.on,主应用发送一次消息,会多次进入starkEvent.on的回调方法
Expected behavior
starkEvent.off(MQTT_MESSAGE, () => {
console.log('航班动态 主应用推送过来的消息监听被移除');
});
能够正常取消监听
Actual behavior
No response
Version of ice.js
"@ice/app": "3.4.10"
Content of build.json or ice.config.mts
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: