Skip to content

Commit

Permalink
Fix: Type error in requestFromUrl
Browse files Browse the repository at this point in the history
When using `requestFromUrl()` in #29026 we noticed errors being thrown
from within `waitForData()`. Investigation revealed this basic type
error that could have been caught by a language and compiler before it
was pushed to production. Yay JS.

This wasn't detected because this function isn't yet being used and we
weren't sure how to test it. Thankfully our fail-fast methodology
prevented this from appearing to our customers.
  • Loading branch information
dmsnell committed Dec 3, 2018
1 parent 9eab699 commit c71a84a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/state/data-getters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { dummyTaxRate } from 'lib/tax'; // #tax-on-checkout-placeholder
*/
export const requestFromUrl = url =>
requestHttpData( `get-at-url-${ url }`, rawHttp( { method: 'GET', url } ), {
fromApi: () => data => [ `get-at-url-${ url }`, data ],
fromApi: () => data => [ [ `get-at-url-${ url }`, data ] ],
} );

export const requestActivityActionTypeCounts = (
Expand Down

0 comments on commit c71a84a

Please sign in to comment.