Options
All
  • Public
  • Public/Protected
  • All
Menu

A Channel allows you to feed arbitrary values into a Signal. This is the simplest way to get started with Signals.

const chan = channel('Hello, Bodil!')
const hello = chan.subscribe()

// For each value sent to the Channel, transform it to uppercase and then log it.
hello.map(value => value.toUpperCase()).on(console.log)

chan.send('This is great!')

Type parameters

  • A

Hierarchy

  • Channel

Index

Methods

send

  • send(val: A): void

subscribe

Static channel

  • Creates a channel, which allows you to feed arbitrary values into a signal.

    Type parameters

    • A

    Parameters

    • val: A

    Returns Channel<A>

Generated using TypeDoc