stateful-title
v1.0.0
Published
Stateful title management.
Downloads
2
Readme
stateful-title
Install
$ npm install --save stateful-title
Usage
const statefulTitle = require('stateful-title')
const title = statefulTitle('old title')
// set new title
title('new title')
// document.title => 'new title'
// reset to old title
title()
// document.title => 'old title'
API
statefulTitle(oldTitle, [set])
It returns a function which accepts a new title as the only parameter to set document.title
. If no new title was specified it defaults to old title.
oldTitle
Type: string
Old document title.
set
Type: boolean
Default: false
Set document.title to oldTitle
.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D