tokopedia / RxComposableArchitecture

RxComposableArchitecture is a forked of Composable Architecture with adjustment to make it work with UIKit.
Apache License 2.0
31 stars 5 forks source link

[Bootstrap x Dependencies] - V1 Support Example #93

Closed dikasetiadi closed 1 year ago

dikasetiadi commented 1 year ago

Adding V1 Support for Example mocking using Bootstrap

usage:

/// 📝 Call Bootstrap in here applied any mocking on closure
///
Bootstrap.mock(for: EnvironmentFeature()) { currentReducer in

    /// 📝 here we can mock our reducer with your mocked dependencies
    ///
    currentReducer.dependency(\.envVCEnvironment, .mockFailed)
}

let viewController = EnvironmentDemoVC()

navigationController?.pushViewController(viewController, animated: true)

How to clear mock:

Bootstrap.clear(for: EnvironmentFeature.self)