                             .filterMap { input, fromState, effect in
                                 return effect.map { (input, fromState, $0) }
                             }
-                            .flatMap(strategy) { input, _, effect -> SignalProducer<Input, NoError> in
+                            .flatMap(strategy) { input, fromState, effect -> SignalProducer<(State, Input), NoError> in
                                 return recurInputProducer(effect, strategy: strategy)
-                                    .prefix(value: input)
+                                    .prefix(value: (fromState, input))
                             }
 
                         let failureSignal = mappingSignal
-                            .filterMap { input, _, effect -> Input? in
-                                return effect == nil ? input : nil
+                            .filterMap { input, fromState, effect -> (State, Input)? in
+                                return effect == nil ? (fromState, input) : nil
                             }
 
                         let mergedProducer = SignalProducer(values: failureSignal, successSignal).flatten(.merge)

        }

        recurInputProducer(SignalProducer(inputSignal), strategy: strategy)
            .withLatest(from: stateProperty.producer)
            .flatMap(.merge) { input, fromState -> SignalProducer<Reply<State, Input>, NoError> in
                if let (toState, _) = mapping(fromState, input) {
                    return .init(value: .success(input, fromState, toState))
                }


        /// Recursive input-producer that sends inputs from `inputSignal`
        /// and also from additional effect generated by `EffectMapping`.
        func recurInputProducer(_ inputProducer: SignalProducer<Input, NoError>, strategy: FlattenStrategy) -> SignalProducer<(State, Input), NoError>
        {
            return SignalProducer<(State, Input), NoError> { observer, disposable in
                inputProducer
                    .withLatest(from: stateProperty.producer)
                    .map { input, fromState in
