Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 558 Bytes

visibility-helper.md

File metadata and controls

17 lines (14 loc) · 558 Bytes

Visibility Helper

Orchestra's Visibility helper is a hidden benefit of the library, it will listen for events from the Page Visibility API (taking into account vendor prefixes for you). When it receives a visibilitychanged event the helper will either fire either an appHidden or appShown request on the main Radio channel.

var Orchestra = require('orchestra');
var mainChannel = Orchestra.Radio.channel('main');

mainChannel.reply(
  appHidden: function() {
    // do something
  },
  appShown: function() {
    // do something
  }
);