UNPKG

@talend/react-cmf-cqrs

Version:

@talend/react-cmf plugin for CQRS backend architecture

33 lines (32 loc) 1.23 kB
declare namespace _default { export { listen }; export { check }; } export default _default; /** * this module define a high level API to handle ack in sagas * @module react-cmf-cqrs/lib/sagas/ack * @example import { channel } from 'redux-saga'; import { fork, take, put, race, call, select } from 'redux-saga/effects'; import { sagas } from '@talend/react-cmf-cqrs'; function* onMyButtonClicked() { const requestId = objectID().toString(); const chan = yield call(channel); yield fork(ack.listen, chan); const action = ... //action with ack and requestId yield put(action); yield call(ack.check, chan, requestId); } */ /** * this function let you listen a channel ACK_RECEIVE_MESSAGE * @param {Object} channel redux-saga channel */ declare function listen(chan: any): Generator<import("redux-saga/effects").TakeEffect | import("redux-saga/effects").ChannelPutEffect<any>, void, unknown>; /** * this function will wait for the ack to be filled. * @param {Object} channel redux-saga channel instance * @param {string} requestId the requestId to check in the channel */ declare function check(chan: any, requestId: string): Generator<import("redux-saga/effects").TakeEffect, boolean, any>;