1.0.7 • Published 7 months ago

noop-ts v1.0.7

Weekly downloads
1,082
License
ISC
Repository
github
Last release
7 months ago

noop-ts

A very simple "do nothing" JavaScript function, compatible with TypeScript. Since the noop accepts any arguments (and does nothing in return), it can be used as a replacement of any function passed as a parameter to another function or a property of a web/React/Angular/(...) component.

That can be particularly useful for unit tests, for example to test a React component:

import noop from 'noop-ts';

describe('MyComponent', () => {
  it('does what I want it to do', () => {
    const component = shallow(<MyComponent onChange={noop} />);
    expect(component).toMatchSnapshot();
  });
});

Installation

npm

npm install noop-ts --save-dev

yarn

yarn add noop-ts --dev
1.0.7

7 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago