Skip to content

Commit

Permalink
Cleanup components
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbruegge committed Oct 8, 2018
1 parent 2729a5c commit cb025de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions template/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,8 @@ export interface State {
counter?: CounterState;
speaker?: SpeakerState;
}
export const defaultState: State = {
counter: { count: 5 },
speaker: undefined // use default state of component
};

export function App(sources: Sources<State>): Sinks<State> {
const initReducer$ = xs.of<Reducer<State>>(
prevState => (prevState === undefined ? defaultState : prevState)
);

const match$ = sources.router.define({
'/counter': isolate(Counter, 'counter'),
'/speaker': isolate(Speaker, 'speaker')
Expand All @@ -44,7 +36,6 @@ export function App(sources: Sources<State>): Sinks<State> {
const sinks = extractSinks(componentSinks$, driverNames);
return {
...sinks,
router: xs.merge(redirect$, sinks.router),
onion: xs.merge(initReducer$, sinks.onion)
router: xs.merge(redirect$, sinks.router)
};
}
2 changes: 1 addition & 1 deletion template/src/components/counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface State {
count: number;
}
export const defaultState: State = {
count: 30
count: 0
};

interface DOMIntent {
Expand Down

0 comments on commit cb025de

Please sign in to comment.