Skip to content

Commit

Permalink
refactor(): Delete history from sources
Browse files Browse the repository at this point in the history
Instead of setting to undefined
  • Loading branch information
jvanbruegge committed Aug 8, 2017
1 parent 88e9028 commit 94e3c12
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/routerify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ function routerify(
};
const createHref = (location: Location) =>
opts.basename + createPath(location);

return function(sources: any): any {
const routerSource = new RouterSource(
xs.from(sources[opts.historyName]),
[],
createHref,
routeMatcher
);
let srcs = sources;
if (opts.omitHistory) {
delete srcs[opts.historyName];
}
const sinks = main({
...sources,
[opts.routerName]: routerSource,
[opts.historyName]: opts.omitHistory
? undefined
: sources[opts.historyName]
...srcs,
[opts.routerName]: routerSource
});
return {
...sinks,
Expand Down

0 comments on commit 94e3c12

Please sign in to comment.