1.0.0 • Published 8 years ago

stateful-title v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

stateful-title

NPM version NPM downloads Build Status

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © EGOIST