2.0.9 • Published 4 years ago
nuxt-plugins-grpc-web-client-stream v2.0.9
nuxt-plugins-grpc-web-client-stream
Install
npm i nuxt-plugins-grpc-web-client-stream
Props
service request grpc metadata (选填) host
Usage
import subscribeEvents from 'nuxt-plugins-grpc-web-client-stream' async beforeStream() { let host = 'https://dengji.wenjuant.com' try { await subscribeEvents( { service: CaseMgm.SubscribeEvent, SubscribeEventRequest, grpc, host, }, { onMsgFun: this.onMsgFun, onUnknownFun: this.onUnknownFun, } ) } catch (error) { if (error.status) { console.log('重连失败,请检查网络链接!') } } }, onMsgFun(val) { console.log(val, '这是接收长链接返回信息的位置') }, onUnknownFun(val) { this.notify({ content: '由于长时间未执行操作,与服务器的链接已断开!', type: 'error', }) }
2.0.9
4 years ago
2.0.8
4 years ago
2.0.7
4 years ago
2.0.6
4 years ago
2.0.5
4 years ago
2.0.4
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.9.0
4 years ago
1.8.0
4 years ago
1.7.0
4 years ago
1.6.0
4 years ago
1.5.0
4 years ago
1.4.0
4 years ago
1.3.0
4 years ago
1.2.0
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago