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
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
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