r-park / todo-redux-saga

Todo app with Create-React-App • React-Redux • Redux-Saga • Firebase • OAuth
https://todo-redux-saga.firebaseapp.com
MIT License
191 stars 49 forks source link

[Question] Saga call with Array #8

Closed ng-hai closed 7 years ago

ng-hai commented 7 years ago

Could you explain to me the 10th line of code? I can't figure out why we must use an array here. Thank you.

r-park commented 7 years ago

Hi @ng-hai — it's a way to pass the this context to firebaseAuth.signInWithPopup.

https://github.com/redux-saga/redux-saga/blob/master/docs/api/README.md#callcontext-fn-args

ng-hai commented 7 years ago

Thank @r-park, I just thought that it would be the same with calling axios method like yield call(axios.post, someParameters).

As your answer, I can rewrite the above method as yield call([axios, axios.post], someParameters), do I right?

r-park commented 7 years ago

That should work.