Merge pull request #12 from sergejs/pod Cocoapods support MVP
Merge pull request #12 from sergejs/pod
Cocoapods support MVP
Package containing easy implamentation of Finite State Machine using Combine
To start using, all you need is to defeine enums with States and Events, and define Transitions.
[ ] Improved logging control
enum TestEvents: EventProtocol { case event1, event2 } enum TestStates: StateProtocol { case initial, step1, step2, step1Alt, finish } let stateMachine = StateMachine<TestEvents, TestStates>(with: .initial) let transition = StateMachineTransition<TestEvents, TestStates>(event: .event1, from: .initial, to: .finish) try? stateMachine.append(transition: transition) stateMachine.transitionQueue.waitUntilAllOperationsAreFinished() XCTAssertEqual(stateMachine.state.value, .initial) stateMachine.event.send(.event1) stateMachine.transitionQueue.waitUntilAllOperationsAreFinished() XCTAssertEqual(stateMachine.state.value, .finish)
Check tests for more usage exmples
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
StateMachine
Package containing easy implamentation of Finite State Machine using Combine
To start using, all you need is to defeine enums with States and Events, and define Transitions.
TODO:
[ ] Improved logging control
Example usage
Check tests for more usage exmples