Simply notify
==========
This is a basic notifier that you can use in your es6 projects or you can use it directly in browser.

[Demo](https://eloquent-aryabhata-d10660.netlify.app/)

### :gear: Installation
```shell script
yarn add simply-notify
```

>If you want  to use it directly in browser check the sample.html file in project root directory.

### :bookmark_tabs: Browser support
It is build for browsers that support all modern features.
Please feel free to adapt it to your custom needs.

### :electric_plug: Dependencies
Check package.json file.

### :memo: Documentation

```js
import simplyNotifyObject from 'simply-notify'
simplyNotifyObject.addDanger('Danger message')
simplyNotifyObject.addInfo('Info message')
simplyNotifyObject.addSuccess('Success message')
simplyNotifyObject.addWarning('Warning message')
```
This code will display 4 toasts on screen. Clicking on one toast will make it disappear.

You can initialize the module to display auto-closing toast by setting a value greater then zero
to timer property.

```js
import simplyNotifyObject from 'simply-notify'
simplyNotifyObject.setTimer(2)
simplyNotifyObject.addDanger('Danger message')
```

This will make any toast displayed to disappear after 2 seconds.

There are four position for your messages: 
```js
BOTTOM_LEFT 
BOTTOM_RIGHT // default
TOP_LEFT
TOP_RIGHT
```
To set a position run 
```js
import simplyNotifyObject from 'simply-notify'
import { TOP_RIGHT } from './src/toast/Position'
simplyNotifyObject.setPosition(TOP_RIGHT)
simplyNotifyObject.addDanger('Danger message')
```
Then all your messages will be displayed top right position.

Defaults:
- Position: ```TOP_RIGHT```
- No timer

> When new position is set, toasts container is remove and recreated to the new position.
> Toasts are preserved and displayed in the new container at new location.

To see the behavior of this library please check the [demo](https://eloquent-aryabhata-d10660.netlify.app/).
#### Development
To start webpack dev server run 
```shell script
yarn start
```

To build the project run 
```shell script
yarn build
```

To run linter run 
```shell script
yarn lint
```

### :heavy_check_mark: Run tests
In project root directory run
```shell script
yarn test
```
or
```shell script
yarn test-watch
```

### :scroll: License
See the [LICENSE](LICENSE.md) file for license rights and limitations.

