GithubHelp home page GithubHelp logo

egeozcan / ppipe Goto Github PK

View Code? Open in Web Editor NEW
195.0 6.0 8.0 491 KB

pipes values through functions, an alternative to using the proposed pipe operator ( |> ) for ES

License: ISC License

JavaScript 100.00%
promise chain async pipe pipe-operator pipes-values

ppipe's Issues

Typescript

Would you like that?

Very cool library btw!

Wrapper Method

I worked on a similar Pipe system a year and a half ago, and I must say, great job!
I compared the functionality of your Pipe versus mine for functionalities that might be of interest, and I came up with one that could be good - returning the pipe as a wrapper function.

From an example code of mine:

function employeePipe() {
  return Pipe.build()
    .pipe(search)
    .map(x => {data: x, tag: x, search: x })
    .wrap();
}

So what happens above is that the pipe is built with a set of operations (search, then map), and then is returned as a function that can be reused. This can be really useful as you can pass the pipe around and use it like any other function.

It is equivalent to

function myPipe(data){
  return ppipe(data)
  .pipe(add, 1)
  .pipe(double)
  .pipe(square)
  .pipe(divide, _, 8)
  .pipe(add, 1)();
}

Let me know what you think!

Cheers ๐Ÿฆ„

Add coverage

Expected Behavior

After running npm test, you should be able to see the coverage of the code. This would make ppipe more trustworthy and would also help people that want to contribute (assuming that there are lines or branches not covered by the current tests). Awesome project btw ๐Ÿ˜ƒ

Actual Behavior

No coverage directory.

Steps to Reproduce the Problem

  1. Run npm test
  2. ls

ES module

How can i use this library, in this way.

import { ppipe } from "ppipe"

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.