store-saga icon indicating copy to clipboard operation
store-saga copied to clipboard

Cannot instantiate cyclic dependency

Open BaruchFisherman opened this issue 8 years ago • 1 comments

Hi,

I'm try to inject Action Creator into Saga middleware function. But Im getting this error: ORIGINAL EXCEPTION: Cannot instantiate cyclic dependency! (Token @ngrx/store Saga Effect -> ApplicativeRoomModel -> Store -> StoreBackend)

` export const BingoRoomSaga = createSaga(function(applicativeRoom: ApplicativeRoomModel) {

return function(saga$: Observable) { return saga$ .filter(iteration => iteration.action.type === 'ACTION') .map((saga) => { ....... }); };

}, [ ApplicativeRoomModel ]); `

ApplicativeRoomModel has: constructor(private store: Store) { ..... }

I found that if i comment the store from constructor it's working just fine. but I need this store.

Any ideas?

BaruchFisherman avatar Apr 05 '16 18:04 BaruchFisherman

Similar to this https://github.com/CodeSequence/store-saga/issues/8

It would be great finding a neat solution other than creating a new service just for injecting the store.

abdulhaq-e avatar Apr 09 '16 19:04 abdulhaq-e