( backend, dispatch, networkAction, token )
| 29 | export const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1); |
| 30 | |
| 31 | export const queryGraphQLWithUIEffects = ( |
| 32 | backend, |
| 33 | dispatch, |
| 34 | networkAction, |
| 35 | token |
| 36 | ) => async (query) => { |
| 37 | try { |
| 38 | dispatch(networkAction(false)); |
| 39 | const response = await queryGraphQL(`${backend}/graph`, query, token); |
| 40 | |
| 41 | return response; |
| 42 | } finally { |
| 43 | dispatch(networkAction(false)); |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | export const formattedLocaleDate = (epochString) => |
| 48 | new Date(Number(epochString)).toLocaleString("en-US"); |
no test coverage detected