Skip to content

Commit

Permalink
chore(npm): Update deps and format
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Sep 26, 2017
1 parent f752e5d commit e220413
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/component/container/App/AppHeader/AppHeaderStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AppHeaderState {

update(subscriptions: Subscription[]) {
return new AppHeaderState({
...this as AppHeaderStateProps,
...(this as AppHeaderStateProps),
totalUnread: this.computeTotalUnread(subscriptions),
totalSubscriptionCount: this.computeTotalSubscriptionCount(subscriptions)
});
Expand All @@ -42,7 +42,7 @@ export class AppHeaderState {
reduce(payload: UpdateHeaderMessageUseCasePayload) {
if (payload instanceof UpdateHeaderMessageUseCasePayload) {
return new AppHeaderState({
...this as AppHeaderStateProps,
...(this as AppHeaderStateProps),
message: payload.message
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ export class AppPreferencesState {

update(preferences: AppPreferences) {
return new AppPreferencesState({
...this as AppPreferencesProps,
...(this as AppPreferencesProps),
...preferences
});
}

reduce(payload: ShowAppPreferenceUseCasePayload | DismissAppPreferenceUseCasePayload) {
if (payload instanceof ShowAppPreferenceUseCasePayload) {
return new AppPreferencesState({
...this as AppPreferencesProps,
...(this as AppPreferencesProps),
isPanelOpened: true
});
} else if (payload instanceof DismissAppPreferenceUseCasePayload) {
return new AppPreferencesState({
...this as AppPreferencesProps,
...(this as AppPreferencesProps),
isPanelOpened: false
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class SubscriptionContentsState {
return content.updatedDate.millSecond >= subscription.lastUpdated.millSecond;
});
return new SubscriptionContentsState({
...this as SubscriptionContentsStateProps,
...(this as SubscriptionContentsStateProps),
subscription,
rawContents: contents,
filteredContents
Expand All @@ -159,27 +159,27 @@ export class SubscriptionContentsState {
) {
if (payload instanceof FocusContentUseCasePayload) {
return new SubscriptionContentsState({
...this as SubscriptionContentsStateProps,
...(this as SubscriptionContentsStateProps),
focusContentId: payload.contentId
});
} else if (payload instanceof ScrollToNextContentUseCasePayload) {
return new SubscriptionContentsState({
...this as SubscriptionContentsStateProps,
...(this as SubscriptionContentsStateProps),
scrollContentId: payload.subscriptionContentId
});
} else if (payload instanceof ScrollToPrevContentUseCasePayload) {
return new SubscriptionContentsState({
...this as SubscriptionContentsStateProps,
...(this as SubscriptionContentsStateProps),
scrollContentId: payload.subscriptionContentId
});
} else if (payload instanceof StartLoadingPayload) {
return new SubscriptionContentsState({
...this as SubscriptionContentsStateProps,
...(this as SubscriptionContentsStateProps),
isContentsLoadings: true
});
} else if (payload instanceof FinishLoadingPayload) {
return new SubscriptionContentsState({
...this as SubscriptionContentsStateProps,
...(this as SubscriptionContentsStateProps),
isContentsLoadings: false
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class SubscriptionListState {
return this;
}
return new SubscriptionListState({
...this as SubscriptionListStateProps,
...(this as SubscriptionListStateProps),
prefetchSubscriptionCount: appPreferences.prefetchSubscriptionCount
});
}
Expand All @@ -88,7 +88,7 @@ export class SubscriptionListState {
return this;
}
return new SubscriptionListState({
...this as SubscriptionListStateProps,
...(this as SubscriptionListStateProps),
currentSubscriptionId
});
}
Expand Down Expand Up @@ -130,7 +130,7 @@ export class SubscriptionListState {
return group;
});
return new SubscriptionListState({
...this as SubscriptionListStateProps,
...(this as SubscriptionListStateProps),
categoryMap,
groups,
groupSubscriptions
Expand All @@ -154,7 +154,7 @@ export class SubscriptionListState {
reduce(payload: ToggleListGroupUseCasePayload) {
if (payload instanceof ToggleListGroupUseCasePayload) {
return new SubscriptionListState({
...this as SubscriptionListStateProps,
...(this as SubscriptionListStateProps),
groups: this.toggleGroup(payload.categoryKey)
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/App/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class App extends Entity<AppIdentifier> {

updatePreferences(preferences: Partial<AppPreferences>): App {
return new App({
...this as AppArgs,
...(this as AppArgs),
preferences: this.preferences.update(preferences)
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/App/Preferences/AppPreferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class AppPreferences {

update(newArgs: Partial<AppPreferencesJSON>): AppPreferences {
return new AppPreferences({
...this as AppPreferencesJSON,
...(this as AppPreferencesJSON),
...newArgs
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/App/User/AppSubscriptionActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class AppSubscriptionActivity {

addItem(item: AppSubscriptionActivityItem) {
return new AppSubscriptionActivity({
...this as AppSubscriptionActivityArgs,
...(this as AppSubscriptionActivityArgs),
items: this.items.concat(item)
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/domain/Subscriptions/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ export class Subscription extends Entity<SubscriptionIdentifier> {

readAll() {
return new Subscription({
...this as SubscriptionArgs,
...(this as SubscriptionArgs),
unread: this.unread.read()
});
}

refreshSubscription(subscriptionArgs: Partial<SubscriptionArgs>) {
return new Subscription({
...this as SubscriptionArgs,
...(this as SubscriptionArgs),
...subscriptionArgs
});
}

updateContents(subscriptionContents: SubscriptionContents) {
return new Subscription({
...this as SubscriptionArgs,
...(this as SubscriptionArgs),
contents: subscriptionContents
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class SubscriptionContents {

updateContents(contents: SubscriptionContent[]) {
return new SubscriptionContents({
...this as SubscriptionContentsArgs,
...(this as SubscriptionContentsArgs),
contents
});
}
Expand All @@ -72,7 +72,7 @@ export class SubscriptionContents {
getContentsWithPredicate(predicate: ((content: SubscriptionContent) => boolean)) {
const filteredContents = this.contents.filter(predicate);
return new SubscriptionContents({
...this as SubscriptionContentsArgs,
...(this as SubscriptionContentsArgs),
contents: filteredContents
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/Subscriptions/SubscriptionUnread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class SubscriptionUnread extends ValueObject {

read(timeStamp?: TimeStamp) {
return new SubscriptionUnread({
...this as SubscriptionUnreadArgs,
...(this as SubscriptionUnreadArgs),
count: 0,
readTimestamp: timeStamp ? timeStamp : TimeStamp.now()
});
Expand Down

0 comments on commit e220413

Please sign in to comment.