Blog posts about programming languages, Swift, Go and more by me.
Refactoring RxJS Code in Angular
Do you work with legacy RxJS code? Have you ever revisited your first few observables in your application? Do you need to fix bugs in an app of your learning phase? Are you still learning best practices for writing reactive code? This guide is for you. Even if you don’t have anything to do with Angular, you may find this interesting. I will show you a way of how to improve your reactive streams in order to understand their functionality in many isolated, but tiny steps. Some of them may offer external dependencies, but we will always show, how to do it manually.
…Never miss a dismiss in Ionic anymore
Have you ever experienced, that some loading indicators just don’t want to dismiss and literally stay forever? Maybe while users tried to login? The short story: you probably forgot to dismiss a loading indicator in some cases.
Within this blogpost you will learn how to declaratively present loading indicators and how to prevent forgetting to dismissing it again.
In our showcase we have a login page, that shall present a loading indicator while the user will be authenticated. The page itself only consists of inputs for our credentials and a login button calling LoginPage.submitLogin
on click inside ion-content
.
CommandMine
Command mine is a concept of a swift library for parsing command line arguments. It is designed to support asynchronous implementations of CLIS, that may even be used inside frameworks.
Definitions
CommandMine is about extracting minerals out of your ore.
let goldmine = Mine<Gold>() // declare your mine
.drift( // One way to get to your gold
named: "init",
digging drift: Drift, // Prepares your Shaft
to shaft: execute // your actual program
)
Shaft
A protocol describing factories of Rails.
…Why I created Rock for Swift CLIs
I excessively make use of the official Swift Package Manager as I usually do some CLIs or other stuff. For this use case it is really great. When developing Apps, Carthage and CocoaPods come in handy, which are great, too. For Web Development there are yarn and NPM, which support project based and global installs. Then there are gem (global) and bundler (project) for ruby based dependencies.
What I missed was an easy way of distribution for Swift CLIs for either projects or globally. Homebrew is great and can handle global installs great, but for some projects the overhead of submitting new formulas seems too high, especially as this has to be a contribution of a user, not its developer, which is exactly the behavior you want for your personal environment. Furthermore it is not meant to pin certain versions of your dependencies. You simply can’t install one dependency in different versions just for some projects you’re working on.
…