@putout/plugin-apply-push
v1.0.1
Published
šPutout plugin adds ability to apply 'push()' bind
Downloads
5,384
Maintainers
Readme
@putout/plugin-apply-push 
The
push()method ofArrayinstances adds the specified elements to the end of an array and returns the new length of the array.(c) MDN
The
bind()method ofFunctioninstances 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-pushRule
{
"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
