---
title: "prefix(untilOutputFrom:)"
framework: combine
role: symbol
role_heading: Instance Method
path: "combine/publisher/prefix(untiloutputfrom:)"
---

# prefix(untilOutputFrom:)

Republishes elements until another publisher emits an element.

## Declaration

```swift
func prefix<P>(untilOutputFrom publisher: P) -> Publishers.PrefixUntilOutput<Self, P> where P : Publisher
```

## Parameters

- `publisher`: A second publisher.

## Return Value

Return Value A publisher that republishes elements until the second publisher publishes an element.

## Discussion

Discussion After the second publisher publishes an element, the publisher returned by this method finishes.

## See Also

### Applying sequence operations to elements

- [drop(untilOutputFrom:)](combine/publisher/drop(untiloutputfrom:).md)
- [dropFirst(_:)](combine/publisher/dropfirst(_:).md)
- [drop(while:)](combine/publisher/drop(while:).md)
- [tryDrop(while:)](combine/publisher/trydrop(while:).md)
- [append(_:)](combine/publisher/append(_:)-1qb8d.md)
- [append(_:)](combine/publisher/append(_:)-69sdn.md)
- [append(_:)](combine/publisher/append(_:)-5yh02.md)
- [prepend(_:)](combine/publisher/prepend(_:)-7wk5l.md)
- [prepend(_:)](combine/publisher/prepend(_:)-v9sb.md)
- [prepend(_:)](combine/publisher/prepend(_:)-5dj9c.md)
- [prefix(_:)](combine/publisher/prefix(_:).md)
- [prefix(while:)](combine/publisher/prefix(while:).md)
- [tryPrefix(while:)](combine/publisher/tryprefix(while:).md)
