import { Saga } from '@redux-saga/types' ; import { all , AllEffect , fork , ForkEffect } from 'redux-saga/effects' ; import { TxSagas } from '../txs/sagas' ; import { VtxconfigSagas } from '../vtxconfig/sagas' ; import { VtxpollSagas } from '../vtxpoll/sagas' ; import { Store } from 'redux' ; import { ContractsSagas } from '../contracts/sagas' ; import { BlocksSagas } from '../blocks/sagas' ; import { VtxcacheSagas } from '../vtxcache/sagas' ; import { AccountsSagas } from '../accounts/sagas' ; export const getSagas = ( store , custom_sagas ? ) : Saga => { if ( ! custom_sagas ) { custom_sagas = [ ] ; } const sagas = [ TxSagas , ContractsSagas , BlocksSagas , AccountsSagas , VtxconfigSagas , VtxpollSagas . bind ( null , store . dispatch , store . getState ) , VtxcacheSagas , ... custom_sagas ] ; const merged_forked_sagas = sagas . map ( ( saga ) : ForkEffect => fork ( saga ) ) ; return function * root ( ) : IterableIterator < AllEffect > { yield all ( merged_forked_sagas ) ; } ; } ;