@putout/plugin-apply-push
🐊Putout plugin adds ability to apply 'push()' bind
Last updated 4 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-apply-push 
SYNC missed versions from official npm registry.

@putout/plugin-apply-push NPM version

The push() method of Array instances adds the specified elements to the end of an array and returns the new length of the array.

(c) MDN

The bind() method of Function instances creates a new function that, when called, calls this function with its this keyword set to the provided value, and a given sequence of arguments preceding any provided when the new function is called.

(c) MDN

🐊Putout plugin adds ability to apply push() bind.

Checkout in 🐊Putout Editor.

Install

npm i @putout/plugin-apply-push

Rule

{
    "rules": {
        "apply-push": "on"
    }
}

❌ Example of incorrect code

const nextActions = [];
const dispatch = createMiddleware(store)((a) => nextActions.push(a));

✅ Example of correct code

const nextActions = [];
const push = nextActions.push.bind(nextActions);
const dispatch = createMiddleware(store)(push);

License

MIT

Current Tags

  • 1.2.1                                ...           latest (a month ago)

5 Versions

  • 1.2.1                                ...           a month ago
  • 1.2.0                                ...           a month ago
  • 1.1.0                                ...           a month ago
  • 1.0.1                                ...           4 months ago
  • 1.0.0                                ...           4 months ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE