JSPM

@coriolis/parametered-projection

1.0.0-alpha2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q36268F
  • License GPL-3.0

Parametered projections for coriolis

Package Exports

  • @coriolis/parametered-projection

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@coriolis/parametered-projection) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Parametered projections for Coriolis

This package provides useful projections and tools to build projections that can be customized.

Install

npm install --save @coriolis/parametered-projection

Usage

import { lastPayloadOfType } from '@coriolis/parametered-projection'

// This projection would return an array of all payloads of events with type "target event type"
const myProjection = ({ useState, useProjection }) => (
  useState(0),
  useProjection(lastPayloadOfType('target event type')),
  (list, event) => [...list, event]
)

Of course this code sample is not doing anything interesting. But parametered projections are really helpful in real world.