@feizheng/next-filter-map

1.0.0 • Public • Published

next-filter-map

Filter after map for next use reduce.

version license size download

installation

npm install -S @feizheng/next-filter-map

usage

import '@feizheng/next-filter-map';

const options = [
  { name: 'One', assigned: true },
  { name: 'Two', assigned: false },
  { name: 'Three', assigned: true }
];

const reduced = nx.filterMap(
  options,
  (item) => item.assigned,
  (item) => {
    return { name: item.name };
  }
);

// [ { name: 'One' }, { name: 'Three' } ]

license

Code released under the MIT license.

/@feizheng/next-filter-map/

    Package Sidebar

    Install

    npm i @feizheng/next-filter-map

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.8 kB

    Total Files

    5

    Last publish

    Collaborators

    • afeiship