Skip to content

Commit aa6d16a

Browse files
author
Tiago Azevedo
committed
Update getQuery
1 parent 223cc01 commit aa6d16a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/shared/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import route from './route';
99
let componentIndex = {};
1010

1111
function getQuery(component) {
12-
if (componentIndex[component]) {
13-
return componentIndex[component]();
14-
}
12+
let query = componentIndex[component] || componentIndex[component.constructor];
1513

16-
throw new Error("No query registered for component: %s", component);
14+
if (query) {
15+
return query();
16+
}
1717
}
1818

1919
function setQuery(component, query) {

0 commit comments

Comments
 (0)