tokopedia / RxComposableArchitecture

RxComposableArchitecture is a forked of Composable Architecture with adjustment to make it work with UIKit.
Apache License 2.0
31 stars 5 forks source link

Old Reducer.pullback CasePath not showing runtimeWarning when the action send is not match with State #99

Closed jeffersonsetiawan closed 11 months ago

jeffersonsetiawan commented 11 months ago

When we are using older reducer style and we send action that not represent the current state, e.g: State is in the .fetching, but we send action store.send(.content(.didTap)), it should sent the runtimeWarning.

myReducer.pullback(
  state: /State.content,
  action: /Action.content,
  environment: { $0 }
)

reported by: @kwekkwek

dikasetiadi commented 11 months ago

hi @jeffersonsetiawan , do we not use .optional() when we do pullback to specific casepath in this issues cases?

jeffersonsetiawan commented 11 months ago

in this case, it's StatePath @dikasetiadi , so it automatically be optional

dikasetiadi commented 11 months ago

okay got it @jeffersonsetiawan i think i have found the root cause why the warning is not raised. can you help tried & see if the warning already show or not using this changes? https://github.com/tokopedia/RxComposableArchitecture/pull/100