-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated principles and added register StagePlanner
- Loading branch information
Showing
23 changed files
with
306 additions
and
204 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
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
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
32 changes: 32 additions & 0 deletions
32
src/concepts/axium/qualities/registerStagePlanner.quality.ts
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,32 @@ | ||
import { defaultMethodCreator } from '../../../model/concept'; | ||
import { Action, ActionType, prepareActionWithPayloadCreator } from '../../../model/action'; | ||
import { AxiumState } from '../axium.concept'; | ||
import { createQuality } from '../../../model/concept'; | ||
import { selectPayload } from '../../../model/selector'; | ||
import { StagePlanner } from '../../../model/stagePlanner'; | ||
|
||
export type RegisterStagePlannerPayload = { | ||
stagePlanner: StagePlanner; | ||
conceptName: string; | ||
} | ||
export const axiumRegisterStagePlannerType: ActionType = 'register Stage Planner to Axium\'s Named Stage Planner list'; | ||
export const axiumRegisterStagePlanner = | ||
prepareActionWithPayloadCreator<RegisterStagePlannerPayload>(axiumRegisterStagePlannerType); | ||
|
||
export function registerSubscriberReducer(state: AxiumState, action: Action): AxiumState { | ||
const payload = selectPayload<RegisterStagePlannerPayload>(action); | ||
const stagePlanners = state.stagePlanners; | ||
const stagePlanner = payload.stagePlanner; | ||
const name = payload.conceptName; | ||
stagePlanners.push({name, ...stagePlanner}); | ||
return { | ||
...state, | ||
stagePlanners, | ||
}; | ||
} | ||
|
||
export const registerStagePlannerQuality = createQuality( | ||
axiumRegisterStagePlannerType, | ||
registerSubscriberReducer, | ||
defaultMethodCreator | ||
); |
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
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
Oops, something went wrong.