Coder Social home page Coder Social logo

apop's Introduction

apop ๐Ÿ

For transformation data. Replaces recursive nested constructions to flow functions

build status apop version

Full documentation

The main idea

  • Array Parse(ap) - apply flow actions to array.
  • Object Parse(op) - apply flow actions to object.

Installation

npm install --save apop

Imports

import ap from 'apop/ap';
import op from 'apop/op';

Contributing

Project is open for new ideas and features:

  • New actions
  • New experiments
  • Support Map, Set
  • Support async usage
  • Support Immutable.js

apop's People

Contributors

greenkeeper[bot] avatar marvelsrp avatar tuchk4 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

marvelsrp

apop's Issues

Config for clear action

let config = {
emptyArray: true,
emptyObject : true,
emptyString: true
nullValue:true,
undefinedValue: true
}

Clear [null] and [undefined]

If array contains null or undefined - must be clear.

{
   key1: [null] - ignore if config.nullValue == true
   key2: [undefined] - ignore if config.undefinedValue == true
}

support Map, Set

support Map, WeakMap?, Set, WeakSet?
add actions: rmk.toMap, rmk.fromMap?

Make docs more simpler

For example doc actions/pick is too complex and it is hard to read and understand.

Make it more simpler:

  • remove complex data structures
  • split and describe each config mode
  • use default data placeholders like foo, bar, baz etc

And same for others md files

Add prettier + husky + lint-staged

npm i --save prettier lint-staged husky

update package.json:

"scripts": {
    "format-backend": "prettier --trailing-comma es5 --single-quote --write  'scripts/**/*.js'",
    "precommit": "lint-staged"
  },
  "lint-staged": {
    "*.js": [
      "prettier --trailing-comma es5 --single-quote --write",
      "git add"
    ]
  }

Idea: async rmk

const formula = rmk(
  // actions
  // ...
  // custom async action
  state => {
    /// any async code that returns Promise
    return Promise.resolve(state);
  }
);

const transformed = await formula({....});

Action request: filter / sort

const data = [
 { x: 0, y: 0},
 { x: 1, y: 1},
 { x: 2, y: 2},
];

rmk(
  rmk.filter(state => state.x === 0 && state.y === 0),
)(data) 

Same for sort action

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.