Skip to content

Instantly share code, notes, and snippets.

@cipolleschi
Created March 22, 2020 13:57
Show Gist options
  • Select an option

  • Save cipolleschi/13f83f68e37cd677ec12de6493bc84da to your computer and use it in GitHub Desktop.

Select an option

Save cipolleschi/13f83f68e37cd677ec12de6493bc84da to your computer and use it in GitHub Desktop.
Dice Roller AppDependencies
import Katana
import Tempura
/// The Container for the dependencies of the App
class AppDependencies:
SideEffectDependencyContainer,
NavigationProvider
{
// The dispatch function that can be used to dispatch
// SideEffects and State Updater
let dispatch: PromisableStoreDispatch
// A closure that returns the most updated version of the state
let getState: GetState
// An object that helps to manage the navigation
let navigator: Navigator
/// Initializer for the AppDependencies
/// - parameter dispatch: the dispatch function that the dependencies must use
/// - parameter getState: the closure that will return the most updated state
required init(dispatch: @escaping PromisableStoreDispatch, getState: @escaping GetState) {
self.dispatch = dispatch
self.getState = getState
self.navigator = Navigator()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment