Actors

The following actors are available globally.

  • A async sequence that wraps a single value and emits a new element whenever the element changes.

    let sequence = CurrentElementAsyncSequence(0)
    print(await sequence.element)
    
    await stream.yield(1)
    print(await sequence.element)
    
    await stream.yield(2)
    await stream.yield(3)
    await stream.yield(4)
    print(await sequence.element)
    
    // Prints:
    // 0
    // 1
    // 4
    
    See more

    Declaration

    Swift

    public actor CurrentElementAsyncSequence<Element> : AsyncSequence