Advertisement
Guest User

chkla

a guest
Jan 22nd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  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. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement