Skip to content

Instantly share code, notes, and snippets.

@robertvunabandi
Created November 18, 2025 05:03
Show Gist options
  • Select an option

  • Save robertvunabandi/918ad0509e7fef2b13373bd19f50fa95 to your computer and use it in GitHub Desktop.

Select an option

Save robertvunabandi/918ad0509e7fef2b13373bd19f50fa95 to your computer and use it in GitHub Desktop.
//
// DataFetcher.swift
// Reading Journal
//
//
import Foundation
protocol DataFetcher {
/// An associated type for this ``DataFetcher``, which links it to a
/// data store.
static var Enum: DataType { get }
/// The type of store that's associated to this ``DataFetcher``
associatedtype Store: DataStore where Store.Fetcher == Self
/// An initializer for this data fetcher. The passed in `store` must
/// match the `Enum` value.
init(store: Store)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment