SHARE
TWEET

chkla

a guest Jan 22nd, 2020 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Instantiate context plugins
  2. var x = new Flybits.context.Location({
  3.   maxStoreSize: 50,
  4.   refreshDelay: 10000
  5. });
  6. var y = new Flybits.context.Connectivity({
  7.   maxStoreSize: 50,
  8.   refreshDelay: 5000
  9. });
  10. /**
  11.  * Remember that every custom context plugin must extend the ContextPlugin
  12.  * abstract class.
  13.  */
  14. var z = new CustomContextPlugin({
  15.   maxStoreSize: 50,
  16.   refreshDelay: 1000
  17. });
  18.  
  19. /**
  20.  * Register plugin instances.  Once registered they will begin collecting
  21.  * context data into a local persistent storage database.  Note the Manager
  22.  * will not yet report these context values to the Flybits Core.
  23.  */
  24. var xStart = Flybits.context.Manager.register(x);
  25. var yStart = Flybits.context.Manager.register(y);
  26. var zStart = Flybits.context.Manager.register(z);
  27.  
  28.  
  29. Promise.all([xStart,yStart,zStart]).then(function(){
  30.   /**
  31.    * It is only after explicit initialization that the context manager will
  32.    * begin reporting values to the Core.
  33.    */
  34.   Flybits.context.Manager.initialize();
  35. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top