Skip to content

Run Logic within Logic, like you can with Sagas? #141

Open
@christian314159

Description

@christian314159

Currently converting some Redux Sagas into Logics and have run into one issue:

We've got a Saga that runs another Saga within it (this Saga is also sometimes triggered independently), like so:

function* sagaA() {
  yield call(api.getSomething, a, b);
  yield sagaB();
  yield put(actionDone());
}

I'm struggling to grasp how to do this with Logic. Or could I do something where I called the other Logic's process method directly from the other?

async process({ getState }, dispatch, done) {
  await api.getSomething(a,b);
  await logicB.process({ getState}, dispatch);
  dispatch(actionDone());
  done()
}

Any ideas/help appreciated, thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions