UNPKG

@loopback/socketio

Version:

LoopBack's WebSocket server based on socket.io

18 lines (14 loc) 551 B
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved. // Node module: @loopback/socketio // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {Provider} from '@loopback/core'; import {SocketIoSendMethod} from '../types'; export class SocketIoSendProvider implements Provider<SocketIoSendMethod> { value(): SocketIoSendMethod { return (done, result) => this.action(done, result); } action(done: Function, result: unknown) { done({result}); } }