Skip to content

Commit 6497a46

Browse files
authored
Merge pull request #7973 from QwikDev/fix-css-properties
fix(repl): console logging
2 parents 1f7294a + 40989c0 commit 6497a46

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/docs/src/repl/bundler/client-events-listener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { QwikSymbolEvent } from '@builder.io/qwik';
22
import type { ReplEvent } from '../types';
33

44
(() => {
5-
const replId = location.pathname.split('/')[2];
5+
const replId = location.pathname.split('/')[3];
66
const origConsole: Record<string, any> = {};
77

88
const sendToServerWindow = (data: Omit<ReplEvent, 'start'>) => {

packages/docs/src/routes/examples/apps/reactivity/auto-complete/app.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ export default component$(() => {
55
<article>
66
This example features an auto-complete component with a debounce of 150 ms.
77
<br />
8-
The function `debouncedGetPeople` needs to be exported because it is used in `useTask$`.
9-
<br />
108
<br />
119
Go ahead, search for Star Wars characters such as "Luke Skywalker", it uses the{' '}
12-
<a href="https://swapi.dev/">Star Wars API</a>
10+
<a href="https://swapi-node.vercel.app/">Star Wars API</a>:
11+
<br />
12+
<br />
1313
<AutoComplete></AutoComplete>
1414
</article>
1515
);
@@ -60,22 +60,23 @@ export const SuggestionsListComponent = (props: { state: IState }) => {
6060
return <li onClick$={() => (props.state.selectedValue = suggestion)}>{suggestion}</li>;
6161
})}
6262
</ul>
63-
) : (
63+
) : props.state.searchInput ? (
6464
<p class="no-results">
65-
<em>No suggestions, you re on your own!</em>
65+
<em>No results</em>
6666
</p>
67-
);
67+
) : null;
6868
};
6969

7070
const getPeople = (searchInput: string, controller?: AbortController): Promise<string[]> =>
71-
fetch(`https://swapi.dev/api/people/?search=${searchInput}`, {
71+
fetch(`https://swapi-node.vercel.app/api/people/?search=${searchInput}`, {
7272
signal: controller?.signal,
7373
})
7474
.then((response) => {
7575
return response.json();
7676
})
7777
.then((parsedResponse) => {
78-
return parsedResponse.results.map((people: { name: string }) => people.name);
78+
debugger;
79+
return parsedResponse.results.map((people: any) => people.fields.name);
7980
});
8081

8182
function debounce<F extends (...args: any) => any>(fn: F, delay = 500) {
@@ -91,4 +92,4 @@ function debounce<F extends (...args: any) => any>(fn: F, delay = 500) {
9192
};
9293
}
9394

94-
export const debouncedGetPeople = debounce(getPeople, 150);
95+
const debouncedGetPeople = debounce(getPeople, 150);

0 commit comments

Comments
 (0)