Skip to content

Commit

Permalink
v0.1.59
Browse files Browse the repository at this point in the history
  • Loading branch information
REllEK-IO committed May 6, 2024
1 parent 0f713f9 commit f2d4d1a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/model/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type KeyedSelector = {
* For usage outside of the Axium, or when subscribed to other Axiums
*/
export const createConceptKeyedSelector =
<T extends Record<string, unknown>>(conceptName: string, keys: string, setKeys?: (number|string)[]): KeyedSelector => {
<T extends Record<string, unknown>>(conceptName: string, keys: DotPath<T>, setKeys?: (number|string)[]): KeyedSelector => {
const selectorBase = [conceptName, ...keys.split('.')];
if (setKeys) {
return {
Expand Down Expand Up @@ -133,7 +133,7 @@ export type DotPath<
export const createUnifiedKeyedSelector = <T extends object>(
concepts: Concepts,
semaphore: number,
keys: string,
keys: DotPath<T>,
setKeys?: (number | string)[]
): KeyedSelector | undefined => {
const concept = concepts[semaphore];
Expand Down Expand Up @@ -330,8 +330,8 @@ export function selectConcept(concepts: Concepts, name: string): Concept | undef
* @param arr a series of keys that points to your targeted slice
* @returns DotPath<T extends object>
*/
export function createAdvancedKeys<T extends object>(arr: unknown[]): string {
return arr.join('.') as string;
export function createAdvancedKeys<T extends object>(arr: unknown[]): DotPath<T> {
return arr.join('.') as DotPath<T>;
}

createConceptKeyedSelector<{something: unknown}>('something', 'something.1' as DotPath<{something:unknown}>);
Expand Down

0 comments on commit f2d4d1a

Please sign in to comment.