Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ChannelType {
- constructor() { this.state = [] }
- state() { return this.state }
- take() { this.state.push("take") }
- put() { this.state.push("put") }
- flush() { this.state.push("flush") }
- close() { this.state.push("close") }
- }
- const channel = new ChannelType()
- // const channel = (function channel() {
- // let state = []
- // return {
- // state: state,
- // take: () => {state.push("take")},
- // put: () => {state.push("put")},
- // flush: () => {state.push("flush")},
- // close: () => {state.push("close")}
- // }
- // })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement