Skip to content

Commit

Permalink
Merge pull request #185 from Phuire-Research/dx
Browse files Browse the repository at this point in the history
Axium Type for DX
  • Loading branch information
REllEK-IO authored Mar 5, 2024
2 parents e63fe4e + 398c23c commit 223d0f6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ When in doubt simplify.
* [Unified Turing Machine](https://github.com/Phuire-Research/Stratimux/blob/main/The-Unified-Turing-Machine.md) - The governing concept for this entire framework.

## Change Log ![Tests](https://github.com/Phuire-Research/Stratimux/actions/workflows/node.js.yml/badge.svg)
### 3/05/24
* Minor DX release, properly exporting Axium type for inclusion in other frameworks.
### 12/14/23
* Set Stage can now properly be set to 0.
### 11/29/23
Expand All @@ -67,6 +69,8 @@ With this change, I will be able to call the underlying pattern a solution to wh

What I am currently addressing is something that has always bothered me in other frameworks and game engines. That once you have your system set up everything is always checked and has an inherit inefficiency built in due to such. With the above planned change, in O(n) I can determine what has changed and prune stages to what is needed. Likewise the same selectors keep the baseline complexity of accessing those changes to the same O(n). As selectors once defined, are a simple retrieval functions with no looping quality.

* *Update 3/05/24*
Releasing a minor update so that Stratimux can be introduced into other frameworks, as the reality of the current release. It that it is ready in a limited scale such as a simple state machine. The main issue with the current approach is a back pressure becomes an issue at higher complexity and starts interfering with branch prediction.
* *Update 12/28/23*
Now that this branch is able to break implementations, the planned scope of this refactor has expanded to move allow this framework to be multithreaded out of the box. This new plan will take some time to implement and will be merged into main when ready.
* *Update 2/14/24*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stratimux",
"license": "GPL-3.0",
"version": "0.1.01",
"version": "0.1.2",
"description": "Unified Turing Machine",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ For the graph programming framework Stratimux,
define the current index file that exports all public functionality for the framework as a module.
$>*/
/*<#*/
export { createAxium, getAxiumState } from './model/axium';
export { createAxium, getAxiumState, Axium } from './model/axium';
export type {
ActionNode,
ActionNotes,
Expand Down
13 changes: 12 additions & 1 deletion src/model/axium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
withLatestFrom,
Subscriber,
catchError,
Subscription,
Observer,
} from 'rxjs';
import { Action, createCacheSemaphores } from './action';
import { strategyBegin } from './actionStrategy';
Expand All @@ -24,6 +26,7 @@ import {
axiumAppendActionListToDialog,
} from '../concepts/axium/qualities/appendActionListToDialog.quality';
import { axiumPreClose } from '../concepts/axium/qualities/preClose.quality';
import { StagePlanner, Staging } from './stagePlanner';

export const blockingMethodSubscription = (action$: Subject<Action>, action: Action) => {
if (
Expand Down Expand Up @@ -75,7 +78,7 @@ export const defaultMethodSubscription = (action$: Subject<Action>, action: Acti
}
};

export function createAxium(name: string, initialConcepts: Concept[], logging?: boolean, storeDialog?: boolean) {
export function createAxium(name: string, initialConcepts: Concept[], logging?: boolean, storeDialog?: boolean): Axium {
const concepts: Concepts = {};
const init = [createAxiumConcept(name, logging, storeDialog), ...initialConcepts];
init.forEach((concept, i) => {
Expand Down Expand Up @@ -169,5 +172,13 @@ export function createAxium(name: string, initialConcepts: Concept[], logging?:
};
}

export type Axium = {
subscribe: (observerOrNext?: Partial<Observer<Concepts>> | ((value: Concepts) => void) | undefined) => Subscription;
unsubscribe: () => void;
close: (exit?: boolean) => void;
dispatch: (action: Action) => void;
stage: (title: string, stages: Staging[], beat?: number) => StagePlanner
}

export const getAxiumState = (concepts: Concepts) => (concepts[0].state as AxiumState);
/*#>*/

0 comments on commit 223d0f6

Please sign in to comment.