var x = 5;
console.log(x);Here is the demo for lepton
| // sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| // sending to all clients, include sender | |
| io.emit('message', "this is a test"); | |
| // sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender |
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |
var x = 5;
console.log(x);Here is the demo for lepton
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
| import {action1, action2} from "myActions"; | |
| import {bindActionCreators} from "redux"; | |
| import {connect} from "react-redux"; | |
| const mapStateToProps = (state, ownProps) = { | |
| return { | |
| counter : state.counter, | |
| someComponentValue : state.things[ownProps.someIdProp] | |
| }; | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="code rxjs for searchbox"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <input id="input"> |
| h1 { | |
| color:red | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="rxjs interval example"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.3/dist/global/Rx.umd.js"></script> | |
| </head> | |
| <body> |