Skip to content

Instantly share code, notes, and snippets.

@ethanjdiamond
Created January 29, 2017 19:38
Show Gist options
  • Save ethanjdiamond/54ae2dcbf6cf17efeddac90c8280196a to your computer and use it in GitHub Desktop.
Save ethanjdiamond/54ae2dcbf6cf17efeddac90c8280196a to your computer and use it in GitHub Desktop.
protocol Interactable: class {//, StoreSubscriber {
associatedtype R: Routable
associatedtype P: Presentable
func configure(store: AppStore, router: R, presenter: P?)
func interactorDidAttach()
func interactorWillDetach()
func newState(state: AppState)
}
class Interactor<R: Routable, P: Presentable>: Interactable {
var store: AppStore!
weak var router: R!
var presenter: P?
func configure(store: AppStore, router: R, presenter: P?) {
self.store = store
self.router = router
self.presenter = presenter
}
func interactorDidAttach() {
//store.subscribe(self)
}
func interactorWillDetach() {
//store.unsubscribe(self)
}
func newState(state: AppState) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment