-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added windowsMeta actions and reducer.
Added activeWindowId state to reducer.
- Loading branch information
Showing
5 changed files
with
65 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Action } from '@ngrx/store'; | ||
|
||
export const SET_ACTIVE_WINDOW_ID = 'SET_ACTIVE_WINDOW_ID'; | ||
|
||
export class SetActiveWindowIdAction implements Action { | ||
readonly type = SET_ACTIVE_WINDOW_ID; | ||
|
||
constructor(public payload: { windowId: string }) {} | ||
} | ||
|
||
export type Action = SetActiveWindowIdAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Action } from '@ngrx/store'; | ||
|
||
import * as windowsMeta from '../../actions/windows-meta/windows-meta'; | ||
|
||
export interface State { | ||
activeWindowId: string; | ||
} | ||
|
||
const initialState: State = { | ||
activeWindowId: '' | ||
}; | ||
|
||
export function windowsMetaReducer(state = initialState, action: windowsMeta.Action): State { | ||
switch (action.type) { | ||
case windowsMeta.SET_ACTIVE_WINDOW_ID: | ||
return Object.assign({}, state, { activeWindowId: action.payload.windowId }); | ||
default: | ||
return state; | ||
} | ||
} |