Migrating from fp-ts RTE to Effect: Managing State Dependencies

I'm migrating from fp-ts RTE to effect and I have the following challenge: there's a big redux state that individual functions declare their dependency on specific parts of the state such as:

interface WithFooState {
  foo: number;
}

declare const foo = (): RTE<WithReduxState<WithFooState>, never, void>>

interface WithBarState {
  bar: string;
}

declare const bar = (): RTE<WithReduxState<WithBarState>, never, void>>


When foo and
bar
is composed into a bigger RTE, the R type ends up being WithReduxState<WithFooState & WithBarState> which works perfectly.

With effect, do I have any other option than making a service factory and creating a service for each and every state slice?
Was this page helpful?