holochain / hc-redux-middleware

a few methods of redux middleware for holochain UI apps
28 stars 5 forks source link

when HC returns an error, two 'FAILURE' actions are dispatched, and payload is null on one #16

Open Connoropolous opened 4 years ago

Connoropolous commented 4 years ago

Pay attention to where the chained calls are, and the .catch at the bottom of this chunk of code.

The problem arises at lines 51-55, and 70-76

https://github.com/holochain/hc-redux-middleware/blob/e26e72325d98fc2b3655409a2705415ef75d5b4b/src/lib/middleware.ts#L50-L76

Connoropolous commented 4 years ago

I also found that it would be better to just dispatch the whole result object, instead of pulling off result.Err and putting it in Error