RxFeedback.swift icon indicating copy to clipboard operation
RxFeedback.swift copied to clipboard

How to test the Event creation?

Open luziqin opened this issue 5 years ago • 0 comments

I find that it is hard to test the event creation.For example i want to query some every 10s.And i write this in

viewDidLoad

method.I'm wandoring how to test the request produce and the event created in the right way?

let query: (Driver<State>) -> Signal<Event> = react(
        request: {state -> QueryRequest? in
            ....
            return QueryRequest()
        },
        effects: {request in
        return Signal.just(Event.query)
        })

Driver<Any>.system(
            initialState: State(),
            reduce: State.reduce,
            feedback: query
            )
            .drive()
            .disposed(by: self.rx.disposeBag)

It seams the only way is run the app and debug.So, is anyone has the same problem as me?

luziqin avatar May 27 '19 10:05 luziqin