Skip to content

A simple javascript library to handle flash messages via Cookies

License

Notifications You must be signed in to change notification settings

fakhir-shad/js-flash-messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-flash-message

Installation

Package Manager

NPM

npm install js-flash-message --save

Basic Usage

First import the library

import Flash from 'js-flash-message'

Create flash message using 'create' method

Flash.create({type: 'success', message: 'Hello World!'});

The create method accepts only 1 parameter which is of type object. Flash will not be set if an empty object is passed.

Retrieve flash message using 'get' method

const flashes = Flash.get()

This method will return an Array of objects containing all the flash messages set. Once received Flash messages will be flushed.

About

A simple javascript library to handle flash messages via Cookies

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published