dependabot[bot] on npm_and_yarn
Bump y18n from 3.2.1 to 3.2.2 … (compare)
apisauce
for calls to my api server so everything in the requests part is handled very well right now. What I wanted to do is make sure I handle possible scenarios that might happen in the production which cannot be reproduced so well manually. Like what if there's an inconsistent state or what if the data is corrupted or what if something happens on put or call. I need to handle those errors too. I'm not concerned about anything breaking in the UI since I'm having error boundaries for them but I need to make sure everything works fine with sagas too. Right now I pretty much have one try catch block in every saga which kind of feels redundant and doesn't look pretty to me. So I was looking for an elegant way to do that.
yield createRequestInstance(); yield watchRequests(); all([fork(duck1), fork(duck2)]);
yield all([fork(duck1), fork(duck2)]);
Hello @everyone
We’re looking for React/React Native engineers to work as part of our community. We have multiple projects and missions, where you choose on what you want to work. There is no hiring process, so keep your resumate... it’s an open organisation, here only our work matter :)
StudioLabs is a 100% remote international company, originally founded in Paris, France. We help companies develop their applications by providing them skills of developers and designers from around the world. We believe in living a life of freedom, where freelancers can choose their missions.
Join our community here:http://bit.ly/2w2BHYO
Error: /Users/aleksandervognildburkow/Projects/redux-saga/packages/core/types/ts3.5/channels.test.ts:24:1
ERROR: 24:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 32:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 45:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 47:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 51:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 56:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 58:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 82:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 90:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 99:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 112:1 expect TypeScript@next: Expected an error on this line, but found none.
ERROR: 116:1 expect TypeScript@next: Expected an error on this line, but found none.
In order for the execution exception of an effect to not affect the whole, I created a wrapper function. For example, the following adds safety to each effect, which solves the problem.
But if my effect is very large, it is very time consuming and not elegant to manually increase the safety. I want to know if there is any way, such as a loop function to automatically add safety to each effect, which makes the code more beautiful.
import { call } from 'redux-saga/effects';
export function safe(sagaFn) {
return function* (action) {
try {
return yield call(sagaFn, action);
} catch (e) {
console.error('[react-demo | Saga Unhandled Exception] This error should be fixed or do some pre check in saga effects function.');
console.error(e);
}
};
}
function* mySaga() {
yield takeEvery('USER_FETCH', safe(fetchUserEffects));
yield takeEvery('TEST_SAGA', safe(testSagaEffects));
yield takeEvery('TEST_SAGA', safe(testSagaEffects2));
}
@aleksanb Just came across your message. Thanks for reaching out! The errors you were pointing out occurred because TS wasn't able to resolve some types and was using any
type as a replacement. So this was actually highly related to the issue I had.
As I said in the PR, I finally found a way to debug and fix it and the PR got merged into master :tada: . Unfortunately, it doesn't seem to work on @Andarist machine and he's unable to release, not sure why. If you want to give it a try 🤷♂️ .
const someresult = yield call(someTypedFunction)
to work, but that's blocked on typescript adding more support, right?