Skip to main content

surfaceReducer

Applies an action to the surface state. Pure: unchanged states are returned by reference so React can skip re-rendering.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { surfaceReducer } from "@mapcairn/core";

function surfaceReducer(state: SurfaceState, action: SurfaceAction): SurfaceState;

Parameters​

  • state (SurfaceState)
  • action (SurfaceAction)

Returns​

SurfaceState

See also​

Source: packages/core/src/surface/surface.ts:273