File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
AmplifyPlugins/DataStore/AWSDataStoreCategoryPluginTests/TestSupport/Mocks Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 66//
77
88import Foundation
9+ import Amplify
910@testable import AWSDataStoreCategoryPlugin
1011
1112class MockStateMachine < S, A> : StateMachine < S , A > {
1213 typealias ExpectActionCriteria = ( _ action: A ) -> Void
13- var expectActionCriteriaQueue : [ ExpectActionCriteria ]
14+ var expectActionCriteriaQueue : AtomicValue < [ ExpectActionCriteria ] >
1415
1516 override init ( initialState: S , resolver: @escaping Reducer ) {
16- self . expectActionCriteriaQueue = [ ]
17+ self . expectActionCriteriaQueue = AtomicValue ( initialValue : [ ] )
1718 super. init ( initialState: initialState, resolver: resolver)
1819 }
1920 override func notify( action: A ) {
20- if let expectActionCriteria = expectActionCriteriaQueue. first {
21+ if let expectActionCriteria = expectActionCriteriaQueue. get ( ) . first {
2122 expectActionCriteria ( action)
22- expectActionCriteriaQueue. removeFirst ( 1 )
23+ expectActionCriteriaQueue. with { $0 . removeFirst ( 1 ) }
2324 }
2425 }
2526 func pushExpectActionCriteria( expectActionCriteria: @escaping ExpectActionCriteria ) {
You can’t perform that action at this time.
0 commit comments