This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

those

1.1.0 • Public • Published

those

those is an alternative to R.curry (from ramda).

Todo

  • thoseN R.curryN alternative

use

import those from "those";
const add = (a, b) => a + b;
const test = those(1);
console.log(test(1)); // returns 2

react

import React from "react";
import those from "those";

const additionToState = (setState, state, value) => setState({ counter: state + value });

export default class AddButtons extends React.Component {
  state = { counter: 0 };

  render() {
    const setState = this.setState.bind(this);
    const add = x => those(additionToState, setState, this.state.counter, x);
    const clear = those(additionToState, setState, 0, 0);
    return (
      <React.Fragment>
        <p>{this.state.counter} <button onClick={clear}>clear</button></p>
        <div>
          <button onClick={add(1)}>1</button>
          <button onClick={add(2)}>2</button>
        </div>
      </React.Fragment>
    );
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i those

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

142 kB

Total Files

10

Last publish

Collaborators

  • _jptrs