< description

Notes, thoughts, failures. A blog.

< tags | sort -R | ಠ_ಠ
soyuka@soyuka.me ~/soyuka.me/tags/javascript/

Angular2 modal component

This article is about creating a simple and re-usable modal component with angular2. Featuring @HostListener, ng-content, and some basic vanilla javascript code!

~900 Words

Angular2 external subscriber in a directive (Output)

You made a great component that leverage reactive forms. The thing is, you want to share this directive, and let users define the Observable that should be used by the custom form component. The naive way to make this work would be to bind that Observable in an @Input, and then use that input in the component. We will see here why it doesn’t feel right and how to implement it as an @Output.

~900 Words

Optimize Web assets with Gulp

Images, css, javascript, fonts, we’re using a lot of things in today’s websites. Every time you add an asset <link>, <script>, @import, the browser will issue a request to fetch it. The number of requests that you’ll send might not matter compared to how heavy your ressources are.

~700 Words

Angular2 providers, view providers and "singletons"

The following is an illustration of how providers act through the angular application, or the components tree. You can control their action scope by using providers or viewProviders so that multiple sibling components share the same instance of that provider.

~400 Words

Benchmarking nodejs streams

I was trying to compare my new streamable haml parser against other implementations and my results kept getting inconsistent. What I didn’t realised at first was that I was trying to compare things that can’t be compared. The first point is obvious: the golden rule of a useful benchmark is to only compare apples and apples. From redis documentation What is benchmarking? First, I should’ve asked myself “What is benchmarking?…