This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
const player = new GameSDK.Player(options); | |
// 2 | |
const roomId = await player.createRoom(options); | |
// 3 | |
player.joinRoom(roomId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C { | |
// private method | |
#foo() { console.log('hi'); } | |
bar() { | |
#foo(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const b = new Bank() | |
Object.getOwnPropertySymbols(b) | |
Object.getOwnPropertySymbols(b.__proto__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _addBalance = Symbol('addBalance') | |
const _logBankChange = Symbol('logBankChange') | |
const _privateData = Symbol('privateData') | |
export default class Bank { | |
constructor() { | |
// public variables | |
this.name = 'B7' | |
// private variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _state = new WeakMap() | |
const _addBalance = new WeakMap() | |
const _logBankChange = new WeakMap() | |
export default class Bank { | |
constructor() { | |
// public variables | |
this.name = 'B7' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// private variables | |
let _balance = 0 | |
let _logs = [] | |
export default class Bank { | |
constructor() { | |
// public variables | |
this.name = 'B7' | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Bank() { | |
// public variables | |
this.name = 'B7' | |
// public methods | |
this.getBalance = function() { | |
return _balance | |
} | |
this.addToBalance = function(count) { | |
_addBalance(count) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream api { | |
zone api 64k; | |
server 127.0.0.1:3000; | |
server 127.0.0.1:3001; | |
} | |
server { | |
listen 8080; | |
location / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream api { | |
server 127.0.0.1:3000; | |
server 127.0.0.1:3001; | |
} | |
server { | |
listen 8080; | |
location / { | |
proxy_pass http://api; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const app = express() | |
const port = process.argv[2] | |
app.get('/', (req, res) => res.send(`Hello World!, port: ${port}`)) | |
app.listen(port, () => console.log(`Example app listening on port ${port}!`)) |