From c609a19ef8962c05ba0cdc471dcb28724f6b8edc Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Thu, 25 Aug 2022 12:02:31 -0400 Subject: [PATCH] glorious noop --- src/Updux.ts | 6 ++++-- src/reducer.test.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Updux.ts b/src/Updux.ts index ffa5084..a776021 100644 --- a/src/Updux.ts +++ b/src/Updux.ts @@ -25,6 +25,8 @@ export type DuxStateSubduxes = keyof C extends never ? unknown : { [K in keyof C]: StateOf }; +type DuxAggregateState = TState & DuxStateSubduxes ; + export class Updux { #localInitial: any = {}; #subduxes; @@ -41,7 +43,7 @@ export class Updux { + get initial(): DuxAggregateState{ if (Object.keys(this.#subduxes).length === 0) return this.#localInitial; return Object.assign( @@ -52,6 +54,6 @@ export class Updux state; + return (state : DuxAggregateState, _action : any) => state; } } diff --git a/src/reducer.test.ts b/src/reducer.test.ts index 82a1e15..838247e 100644 --- a/src/reducer.test.ts +++ b/src/reducer.test.ts @@ -3,7 +3,7 @@ import { test, expect } from 'vitest'; import { Updux } from './Updux.js'; test('basic reducer', () => { - const dux = new Updux({}); + const dux = new Updux({ initial: {a: 3} }); expect(dux.reducer).toBeTypeOf('function');