(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| COMPILED_COFFEE = ' < -' | |
| PLAIN_JS = '<-' | |
| thenify = (lines) -> | |
| [line, rest...] = lines | |
| if rest.length is 0 | |
| line | |
| else if line.search(PLAIN_JS) > 0 or line.search(COMPILED_COFFEE) > 0 | |
| [value, promise] = line.split if line.search(PLAIN_JS) > 0 then PLAIN_JS else COMPILED_COFFEE | |
| noSemiColon = promise.slice(0, -1) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| If you are attempting to call an AJAX API, via GET which responds: | |
| No 'Access-Control-Allow-Origin' header is present on the requested resource. | |
| You can modify the way you query it to go through a server which will add the header. | |
| Basically, you add the URL you want (with query string parameters) at the end of | |
| 'https://cors-anywhere.herokuapp.com/' | |
| , and ensure that your ajax call is done with some additional options as shown below | |
| See CORS-Anywhere documentation here for more: |