diff --git a/src/Updux.ts b/src/Updux.ts index 5527ab2..ffa5084 100644 --- a/src/Updux.ts +++ b/src/Updux.ts @@ -50,4 +50,8 @@ export class Updux initial), ); } + + get reducer() { + return (state, action) => state; + } } diff --git a/src/reducer.test.ts b/src/reducer.test.ts new file mode 100644 index 0000000..82a1e15 --- /dev/null +++ b/src/reducer.test.ts @@ -0,0 +1,11 @@ +import { test, expect } from 'vitest'; + +import { Updux } from './Updux.js'; + +test('basic reducer', () => { + const dux = new Updux({}); + + expect(dux.reducer).toBeTypeOf('function'); + + expect(dux.reducer({ a: 1 }, { type: 'foo' })).toMatchObject({ a: 1 }); // noop +});