How to use the prelude-ts.Option.of function in prelude-ts

To help you get started, we’ve selected a few prelude-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github klemola / foobar2000-web-ui / server / Message.ts View on Github external
l => {
            const messageResult = parseMessage(l)
            return messageResult.success
                ? Option.of(messageResult.value)
                : Option.none()
        }
    )
github klemola / foobar2000-web-ui / ui / App.tsx View on Github external
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 }))