Closed walshe closed 7 years ago
I'm glad you asked. It means higher-order component. 🖖
https://facebook.github.io/react/docs/higher-order-components.html
ah I see, nice :) btw would be nice to have some sort of error handling when for example an api component encounters an error.
There are different kinds of errors.
If we actually get a response from the server it's caught here and handed back to the caller (usually actions): https://github.com/jedireza/aqua/blob/b3072fa11748a50ffbc16e0aee71ceca316c0cc2/client/helpers/json-fetch.js#L38-L58
We created some proxy functions for calling the API here: https://github.com/jedireza/aqua/blob/b3072fa11748a50ffbc16e0aee71ceca316c0cc2/client/actions/api.js
And these functions can take a callback as seen here: https://github.com/jedireza/aqua/blob/b3072fa11748a50ffbc16e0aee71ceca316c0cc2/client/pages/login/actions.js#L32-L47
So you should have everything you need to catch errors.
Oh and let's not forget that the redux stores often use the ParseValidation
helper here: https://github.com/jedireza/aqua/blob/b3072fa11748a50ffbc16e0aee71ceca316c0cc2/client/pages/contact/store.js#L24
ah super, thanks
curious what does 'hoc' mean ?