@coriolis/parametered-projection

    1.0.0-alpha2 • Public • Published

    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.

    Install

    npm i @coriolis/parametered-projection

    DownloadsWeekly Downloads

    2

    Version

    1.0.0-alpha2

    License

    GPL-3.0

    Unpacked Size

    59.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar