-
-
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.
Merge pull request #241 from Phuire-Research/Refinement
Refinement
- Loading branch information
Showing
188 changed files
with
5,808 additions
and
5,245 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux and Chain Concept, | ||
generate a quality will add actions into the Chain's actionQue state property. | ||
$>*/ | ||
/*<#*/ | ||
import { Action, AnyAction } from '../../../model/action'; | ||
import { createQualityCardWithPayload } from '../../../model/quality'; | ||
import { selectPayload } from '../../../model/selector'; | ||
import { ChainState } from '../chain.concept'; | ||
|
||
export type ChainPrepareChainPayload = { | ||
actions: AnyAction[] | ||
} | ||
|
||
export const chainPrepareChain = createQualityCardWithPayload<ChainState, ChainPrepareChainPayload>({ | ||
type: 'dispatch Actions from Action Que via Payload to be Chained', | ||
reducer: (state, {payload}) => { | ||
return { | ||
actionQue: [ | ||
...state.actionQue, | ||
...payload.actions | ||
] | ||
}; | ||
} | ||
}); | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux and Chain Concept, | ||
generate a quality will add actions into the Chain's actionQue state property. | ||
$>*/ | ||
/*<#*/ | ||
import { AnyAction } from '../../../model/action/action.type'; | ||
import { createQualityCardWithPayload } from '../../../model/quality'; | ||
import { ChainState } from '../chain.concept'; | ||
|
||
export type ChainPrepareChainPayload = { | ||
actions: AnyAction[] | ||
} | ||
|
||
export const chainPrepareChain = createQualityCardWithPayload<ChainState, ChainPrepareChainPayload>({ | ||
type: 'dispatch Actions from Action Que via Payload to be Chained', | ||
reducer: (state, {payload}) => { | ||
return { | ||
actionQue: [ | ||
...state.actionQue, | ||
...payload.actions | ||
] | ||
}; | ||
} | ||
}); | ||
/*#>*/ |
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 |
---|---|---|
@@ -1,42 +1,43 @@ | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux generate a Counter Concept that will keep track of a count in its state. | ||
$>*/ | ||
/*<#*/ | ||
import { counterAdd } from './qualities/add.quality'; | ||
import { counterSubtract } from './qualities/subtract.quality'; | ||
import { counterSetCount } from './qualities/setCount.quality'; | ||
import { Concept, createConcept } from '../../model/concept'; | ||
import { counterMultiply } from './qualities/multiply.quality'; | ||
export { countingStrategy } from './strategies/counting.strategy'; | ||
|
||
export type CounterState = { | ||
count: number | ||
} | ||
|
||
export const counterName = 'counter'; | ||
|
||
const initialCounterState: CounterState = { | ||
count: 0 | ||
}; | ||
|
||
const counterQualities = { | ||
counterAdd, | ||
counterSubtract, | ||
counterSetCount, | ||
counterMultiply | ||
}; | ||
|
||
export type CounterDeck = { | ||
counter: Concept<CounterState, typeof counterQualities>, | ||
}; | ||
|
||
export type CounterQualities = typeof counterQualities; | ||
|
||
export const createCounterConcept = () => { | ||
return createConcept<CounterState, CounterQualities>( | ||
counterName, | ||
initialCounterState, | ||
counterQualities | ||
); | ||
}; | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux generate a Counter Concept that will keep track of a count in its state. | ||
$>*/ | ||
/*<#*/ | ||
import { counterAdd } from './qualities/add.quality'; | ||
import { counterSubtract } from './qualities/subtract.quality'; | ||
import { counterSetCount } from './qualities/setCount.quality'; | ||
import { createConcept } from '../../model/concept/concept'; | ||
import { Concept } from '../../model/concept/concept.type'; | ||
import { counterMultiply } from './qualities/multiply.quality'; | ||
export { countingStrategy } from './strategies/counting.strategy'; | ||
|
||
export type CounterState = { | ||
count: number | ||
} | ||
|
||
export const counterName = 'counter'; | ||
|
||
const initialCounterState: CounterState = { | ||
count: 0 | ||
}; | ||
|
||
const counterQualities = { | ||
counterAdd, | ||
counterSubtract, | ||
counterSetCount, | ||
counterMultiply | ||
}; | ||
|
||
export type CounterDeck = { | ||
counter: Concept<CounterState, typeof counterQualities>, | ||
}; | ||
|
||
export type CounterQualities = typeof counterQualities; | ||
|
||
export const createCounterConcept = () => { | ||
return createConcept<CounterState, CounterQualities>( | ||
counterName, | ||
initialCounterState, | ||
counterQualities | ||
); | ||
}; | ||
/*#>*/ |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux and Counter Concept, generate a KeyedSelector for the Counter's count state property. | ||
$>*/ | ||
/*<#*/ | ||
import { KeyedSelector, createConceptKeyedSelector } from '../../model/selector'; | ||
import { CounterState } from './counter.concept'; | ||
|
||
export const counterSelectCount: KeyedSelector = createConceptKeyedSelector<CounterState>('counter', 'count'); | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux and Counter Concept, generate a KeyedSelector for the Counter's count state property. | ||
$>*/ | ||
/*<#*/ | ||
import { createConceptKeyedSelector } from '../../model/selector/selector'; | ||
import { KeyedSelector } from '../../model/selector/selector.type'; | ||
import { CounterState } from './counter.concept'; | ||
|
||
export const counterSelectCount: KeyedSelector = createConceptKeyedSelector<CounterState>('counter', 'count'); | ||
/*#>*/ |
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux and Counter Concept, | ||
generate a quality that set the state property count to the new count provided | ||
by the action's payload. | ||
$>*/ | ||
/*<#*/ | ||
import { defaultMethodCreator } from '../../../model/quality'; | ||
import { CounterState } from '../counter.concept'; | ||
import { counterSelectCount } from '../counter.selector'; | ||
import { selectPayload } from '../../../model/selector'; | ||
import { createQualityCardWithPayload } from '../../../model/quality'; | ||
|
||
export type CounterSetCountPayload = { | ||
newCount: number | ||
} | ||
export const counterSetCount = createQualityCardWithPayload<CounterState, CounterSetCountPayload>({ | ||
type: 'Counter set Count', | ||
reducer: (state, {payload}) => { | ||
const {newCount} = payload; | ||
return { | ||
count: newCount | ||
}; | ||
}, | ||
methodCreator: defaultMethodCreator, | ||
keyedSelectors: [counterSelectCount] | ||
}); | ||
/*<$ | ||
For the asynchronous graph programming framework Stratimux and Counter Concept, | ||
generate a quality that set the state property count to the new count provided | ||
by the action's payload. | ||
$>*/ | ||
/*<#*/ | ||
import { defaultMethodCreator } from '../../../model/quality'; | ||
import { CounterState } from '../counter.concept'; | ||
import { counterSelectCount } from '../counter.selector'; | ||
import { selectPayload } from '../../../model/selector/selector'; | ||
import { createQualityCardWithPayload } from '../../../model/quality'; | ||
|
||
export type CounterSetCountPayload = { | ||
newCount: number | ||
} | ||
export const counterSetCount = createQualityCardWithPayload<CounterState, CounterSetCountPayload>({ | ||
type: 'Counter set Count', | ||
reducer: (state, {payload}) => { | ||
const {newCount} = payload; | ||
return { | ||
count: newCount | ||
}; | ||
}, | ||
methodCreator: defaultMethodCreator, | ||
keyedSelectors: [counterSelectCount] | ||
}); | ||
/*#>*/ |
Oops, something went wrong.