(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.
| /** | |
| * Object type that represents all possible paths of an object, | |
| * including optional members. | |
| * @template T The object type to get the paths from. | |
| * @see https://stackoverflow.com/a/76131375/10851645 | |
| * @see https://gist.github.com/albertms10/5a8b83e436a1689aa4b425ec22058301 | |
| * @example | |
| * interface Package { | |
| * name: string; | |
| * man?: string[]; |
(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.
| // based on https://github.com/processing/processing/blob/a6e0e227a948e7e2dc042c04504d6f5b8cf0c1a6/core/src/processing/core/PApplet.java#L5093 | |
| var scale = function(opts){ | |
| var istart = opts.domain[0], | |
| istop = opts.domain[1], | |
| ostart = opts.range[0], | |
| ostop = opts.range[1]; | |
| return function scale(value) { | |
| return ostart + (ostop - ostart) * ((value - istart) / (istop - istart)); |