Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Instantiate context plugins
- var x = new Flybits.context.Location({
- maxStoreSize: 50,
- refreshDelay: 10000
- });
- var y = new Flybits.context.Connectivity({
- maxStoreSize: 50,
- refreshDelay: 5000
- });
- /**
- * Remember that every custom context plugin must extend the ContextPlugin
- * abstract class.
- */
- var z = new CustomContextPlugin({
- maxStoreSize: 50,
- refreshDelay: 1000
- });
- /**
- * Register plugin instances. Once registered they will begin collecting
- * context data into a local persistent storage database. Note the Manager
- * will not yet report these context values to the Flybits Core.
- */
- var xStart = Flybits.context.Manager.register(x);
- var yStart = Flybits.context.Manager.register(y);
- var zStart = Flybits.context.Manager.register(z);
- Promise.all([xStart,yStart,zStart]).then(function(){
- /**
- * It is only after explicit initialization that the context manager will
- * begin reporting values to the Core.
- */
- Flybits.context.Manager.initialize();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement