Git Product home page Git Product logo

iter-ops-extras's Introduction

iter-ops-extras

โญ Collection of custom operators for iter-ops - ones based on existing operators.

๐Ÿ’ก It is here to show implementation examples, plus share ideas of useful operations.

๐Ÿ“‹ These are just quick copy-n-paste snippets, they are not distributed anywhere.

๐Ÿ“ฃ Feel free submitting PR-s with your own custom operators, to share with others.


  • appendIf - conditionally injects value(s) after the current value.
  • average - emits an average value, with optional key selector.
  • distinctUntilChanged - filters out repeated values.
  • distinctValues - selects unique key-values, then remaps into just values.
  • group - groups objects by a property value.
  • join - joins strings, with optional separator.
  • mapWait - remaps and sequentially awaits promises.
  • max - emits maximum value, with optional key selector.
  • min - emits minimum value, with optional key selector.
  • numberStats - emits basic number statistics: {min, max, avg, sum, count}.
  • pluck - maps each value to its specified nested property.
  • prependIf - conditionally injects value(s) before the current value.
  • removeNotType - removes values that are not of specified primitive type(s).
  • removeType - removes values of specified primitive type(s).
  • removeNil - removes all null and undefined values.
  • repeatAll - repeats the entire iterable N times.
  • replaceIf - conditionally injects value(s) in place of the current value.
  • replaceNil - replaces every null and undefined with an alternative value.
  • slice - implements Array->slice logic (for positive start/end only).
  • sum - sums up values, with optional key selector.
  • tapLog - logs values into the console, with optional tag + selector.
  • tapOnce - taps into the very first value only.
  • toBuffer - emits a Buffer from the iterable.
  • toReadable - emits a Readable stream from the iterable.

To use these, create a folder in your project, and copy over either select operators or the entire ./src folder, which also has file ./src/index.ts that includes everything.

Some of these operators may eventually land in the main iter-ops library. Use Discussions, if you want to propose and vote on such additions.

See also Custom Operators - explains API for custom operators.

๐Ÿ’ก TIP: Operators consume and concurrencyFork are useful helpers for custom operators.

iter-ops-extras's People

Contributors

vitaly-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rebeccastevens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.