Last active
July 18, 2019 16:09
-
-
Save sliim35/00149217ddf8b6a3acced4941aea980e to your computer and use it in GitHub Desktop.
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 createQuery(connection) { | |
| return function query(sql) { | |
| return connection.query(sql) | |
| } | |
| } | |
| function createOrder(query) { | |
| return function order() { | |
| query('blalblbalbbla') | |
| } | |
| } | |
| const connection = { | |
| query: (q) => console.log(q) | |
| } | |
| const query = createQuery(connection); | |
| const order = createOrder(query); | |
| order() // blalblbalbbla |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment