1.0.0 • Published 4 years ago

@feizheng/next-filter-map v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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.

1.0.0

4 years ago