Skip to content
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e3bfb66
add typescript support to issue-tracker
renanmav Nov 12, 2019
ec59071
revert prettier config
renanmav Nov 13, 2019
02ae738
replace non-null assertions for optional chaining on Root
renanmav Nov 13, 2019
a8424c6
throw if router doesnt exists on Link and remove unnecessary chaining…
renanmav Nov 13, 2019
f694d38
move RouteComponentProps to RouteRenderer
renanmav Nov 13, 2019
9abf9fb
avoid braceless
renanmav Nov 13, 2019
32c099d
update comment about @ts-ignore on RelayEnvironment.ts
renanmav Nov 13, 2019
bdb47e0
make Resource more precise
renanmav Nov 13, 2019
97007ce
revert IssueListItem to IssuesListItem
renanmav Nov 13, 2019
e2098e2
revert README changes
renanmav Nov 13, 2019
2c6a186
revert more README changes
renanmav Nov 13, 2019
d8411c5
revert e to event on IssueActions
renanmav Nov 13, 2019
0285f0f
force rename of GitHub
renanmav Nov 14, 2019
dd2786c
return Suspense with null fallback inside SuspenseList
renanmav Nov 14, 2019
4988da4
rename fragment IssueListItem to IssuesListItem
renanmav Nov 15, 2019
927e2eb
make result either T of obj with default
renanmav Nov 15, 2019
f6547ee
revert disable button on IssueActions
renanmav Nov 15, 2019
706cd71
revert the arrow function on Root
renanmav Nov 15, 2019
ab0b7ea
revert concat on RouteRenderer
renanmav Nov 15, 2019
58e89a3
make prepare a mandatory function
renanmav Nov 15, 2019
263a82e
use FetchFunction instead of typing function args
renanmav Nov 15, 2019
6807f0c
throw this.load() func on read() JSResource
renanmav Nov 15, 2019
da5ec35
remove optional chaining
renanmav Nov 15, 2019
a0d4660
throw if there isnt a router on RouteRenderer
renanmav Nov 18, 2019
d621941
remove unnecessary assertions on router
renanmav Nov 18, 2019
871bdca
add type guardian on JSResource
renanmav Nov 18, 2019
6836fbd
make RouteConfig entry general
renanmav Nov 19, 2019
af5b394
revert changes on README
renanmav Nov 19, 2019
7ddec0c
revert changes on README
renanmav Nov 19, 2019
01baff6
use React.FC
renanmav Nov 19, 2019
79e1a5e
add macro config to avoid false positive errors on yarn start
renanmav Nov 19, 2019
aa5def7
make all react components as React.FC
renanmav Nov 20, 2019
7cd9538
Merge branch 'master' into feat/issue-tracker-ts
renanmav Nov 20, 2019
cc1c367
Update README.md
renanmav Nov 20, 2019
5ba1807
Update .prettierrc
renanmav Nov 20, 2019
71ce2bf
remove unnecessary children prop
renanmav Nov 20, 2019
3d8ba57
Merge branch 'feat/issue-tracker-ts' of github.com:renanmav/relay-exa…
renanmav Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make prepare a mandatory function
  • Loading branch information
renanmav committed Nov 15, 2019
commit 58e89a31238a7bb56c8a843f06575f0ef2553462
4 changes: 2 additions & 2 deletions issue-tracker/src/routing/createRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface RouteConfig {
exact?: boolean;
strict?: boolean;
component: Resource<GenericRouteComponent>;
prepare?: (params: {
prepare: (params: {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not dead necessary for this example, but how about making prepare optional, so we can use the router for non-relay routes also?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, but a comment made by @josephsavona:

this could be non-optional

[key: string]: string;
}) => { [queryName: string]: PreloadedQuery<any> };
routes?: RouteConfig[];
Expand Down Expand Up @@ -131,7 +131,7 @@ function matchRoute(routes: RouteConfig[], location: Location) {
function prepareMatches(matches: MatchedRoute<{}>[]): Entry[] {
return matches.map(match => {
const { route, match: matchData } = match;
const prepared = route.prepare!(matchData.params);
const prepared = route.prepare(matchData.params);
const Component = route.component.get();
if (Component == null) {
route.component.load(); // eagerly load
Expand Down