Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The akioma.SocketConnection class is used to encapsulate every socket communication. The class provides methods, for connect, disconnect, seting global listeners and functionalities like showMessage, openContainer and others.

SocketConnection Helper class

A helper class is provided by the SWAT framework in order to easily emit events, add event listeners or to check if connection was established successfully.

Code Block
titleExample using isConnected and emit Helper methods
const isConnected:boolean = akioma.SocketConnectionHelper.isConnected();

if(isConnected) {
	akioma.SocketConnectionHelper.emit('openScreen', { name: 'offerw' });
}


Code Block
titleSocketConnection Helper Listener
akioma.SocketConnectionHelper.on('openScreen', (payload:any) => {
	if(payload.name) {
		akioma.swat.App.loadScreen({ containerName: payload.name });
	}
});



Ui-connector routes:

Code Block
languagejs
var controller = require('../controllers/ui-connector');
router.get('*', controller.all);

...