subscribe(context:subscriber:)

Subscribes to external updates.

SharedReaderKey.swift:40
func subscribe(context: LoadContext<Value>, subscriber: SharedSubscriber<Value>) -> SharedSubscription

Parameters

context

The context of subscribing to updates.

subscriber

A continuation that can be fed new results from an external system, or the initial value if the external system no longer holds a value.

Returns

A subscription to updates from an external system. If it is cancelled or deinitialized, subscriber will no longer receive updates from the external system.