Skip to content

Instantly share code, notes, and snippets.

View digitalsweetspot's full-sized avatar

Jon Hopewell digitalsweetspot

View GitHub Profile

https://medium.com/@ExplosionPills/rxjs-switch-switchmap-and-other-map-operations-e8ccdfb7e5a9 is more up-to-date.

Exploring RxJS still feels like a jungle to me. Even when I think I understand something, I find out that I actually don't understand it. In my quest to truly understand it, I end up learning quite a lot more about some other topics or operations than the one I was originally trying to understand. This is generally a positive thing, but it still feels like traveling deep into a jungle to me.

Just today I was trying to learn how to use ngrx/store with ngrx/effects to use http requests with an ngrx/store-backed app. This introduced me to the RxJS Observable switchMap operator that I was not familiar with. The main question I came up with -- the question that I usually have when

/**
* An alias for console.log. Only logs messages if the browser
* supports 'console' and the script is running in a dev environment.
*
* @param {Mixed} Any number of arguments
* @return {Undefined}
*/
var safeLog = (function(){
var url = window.location.href,
logAllowed = url.indexOf('8888') > -1 && window.console;