How to use the now.nowInitialize function in now

To help you get started, we’ve selected a few now examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github omorandi / tiws / test / Resources / app.js View on Github external
else if ('socket.io' === test) {
	var io = require('socket.io'),
	socket = io.connect(uri);

	socket.on('connect', function () {
		Ti.API.log('connected!')
	});
}

// ****************************************************************************************************************
// ****************************************************************************************************************
// example using now.js which uses socket.io which uses websockets

else if ('nowjs' === test) {
	var now = require('now').nowInitialize(uri, {
		// socket.io init options
		socketio: {
			transports: ['websocket']
		}
	});

	now.core.on('error', function () {
		Ti.API.error('error!')
	});

	now.core.on('ready', function () {
		Ti.API.log('now is now ready')
	});

	now.core.on('disconnect', function () {
		Ti.API.log('now disconnected');
github dbankier / TiShadow / app / modules / android / net.iamyellow.tiws / 3.0.0 / example / app.js View on Github external
else if ('socket.io' === test) {
	var io = require('socket.io'),
	socket = io.connect(uri);
	
	socket.on('connect', function () {
		Ti.API.log('connected!')
	});
}

// ****************************************************************************************************************
// ****************************************************************************************************************
// example using now.js which uses socket.io which uses websockets

else if ('nowjs' === test) {
	var now = require('now').nowInitialize(uri, {
		// socket.io init options
		socketio: {
			transports: ['websocket']
		}
	});

	now.core.on('error', function () {
		Ti.API.error('error!')
	});

	now.core.on('ready', function () {
		Ti.API.log('now is now ready')
	});

	now.core.on('disconnect', function () {
		Ti.API.log('now disconnected');

now

The command-line interface for Vercel

Apache-2.0
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis