question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getQuerySelector(...)=>(state) expects 2 arguments

See original GitHub issue

getQuerySelector()=>() requires 2 arguments, but I think the second should be made optional. This is not a syntax error, just a linting issue. Not sure I syntaxed that explanation correctly, so here is an example.

const getStuff = getQuerySelector({ type: types.LOAD_STUFF });

const stuff = getStuff(state);

In the above example, getStuff(state) will produce a linting error saying that the function requires 2 arguments, the second argument is expected to be props, the same stuff that’s already been passed to the getQuerySelector call.

Unless I misunderstand the way that the result of getQuerySelector should be used… 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
klis87commented, Apr 26, 2020

@zeraien above example was specific reason why getQuerySelector was created, to save people one arrow function 😃

I will fix this issue before the next release, which should come within 1 week. Don’t be surprised though, it will actually have name change into @redux-requests/core and won’t depend on saga anymore. Albeit usage with sagas will still be possible.

0reactions
klis87commented, Apr 29, 2020

Fixed in 0.28.0, thx for reporting this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use reselect selector with parameters - Stack Overflow
The input selector's second parameter is how we get it. Here's how the selector would look, const selectNumOfTodosWithIsDoneValue = createSelector( (state) => ...
Read more >
Document.querySelector() - Web APIs | MDN
The Document method querySelector() returns the first Element within the document that matches the specified selector, or group of selectors ...
Read more >
jQuery and Ajax Tutorial
EXAMPLE 2: Ajax Request with POST Parameters to PHP HTTP Server. In this example, we trigger an Ajax POST request to a PHP...
Read more >
@testing-library/jest-dom - npm
Custom jest matchers to test the state of the DOM. Latest version: 5.16.5, ... toBeInTheDocument() expect(getByTestId(document.
Read more >
API Reference | Vitest
import { describe, test } from 'vitest' // The two tests marked with ... in the test name in the order of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found