Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
l => {
const messageResult = parseMessage(l)
return messageResult.success
? Option.of(messageResult.value)
: Option.none()
}
)
this.socket.on('message', (message: Message) => {
switch (message.type) {
case 'playback':
return this.setState({
currentTrack: Option.of(message.data)
})
case 'volume':
return this.setState({
volume: message.data
})
}
})
this.socket.on('connect', () => this.setState({ connected: true }))