Nocturnal Pumpkin Maelstrom

    observ-visibility

    1.0.0 • Public • Published

    observ-visibility Build Status

    An observable interface to the page visibility api

    Install

    $ npm install --save observ-visibility
    

    Usage

    var Visible = require('observ-visibility')
    var visibile = Visible()
     
    visible()
    //=> true
     
    // switch tabs...
     
    visible()
    //=> false

    API

    visible([fn]) -> boolean / function

    fn

    Type: function

    An optional function to call when the visibility state changes. If no value is provided, the current visibility state is returned. If a function is provided, an unlisten function is returned.

    License

    MIT © Ben Drucker

    Install

    npm i observ-visibility

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • bendrucker