You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to figure out a fix! The url property needs to be included in the map call piped into the ajax request, as well as the initial map whenever term.length < 2:
consthandleInput=pipe(pluck('target','value'),debounceTime(250),distinctUntilChanged(),/* map a fn which returns an object, fn, or Observable (which returns an object, fn, or Observable) */map(term=>props=>{console.log('props',props);// updatedif(term.length<2)return{people: [],term: "",url: props.url}returnajax(`${props.url}?username_like=${term}`).pipe(pluck('response'),map(people=>({// updatedurl: props.url,
term,people: people ? people.slice(0,10) : []})));}));
props.url
inhandleInput
is available on the first search, but in subsequent searches, it is listed asundefined
.This behavior occurs on both your codesandbox.io examples, and when trying to follow along with examples in Stackblitz.
Here's an example screenshot logging the URL whenever two searches are attempted:
I'm pretty new to React, so I'm not sure what would be causing this, but thought you might want to know about this behavior.
The text was updated successfully, but these errors were encountered: