Check out "Do you speak JavaScript?" - my latest video course on advanced JavaScript.
Language APIs, Popular Concepts, Design Patterns, Advanced Techniques In the Browser

Markup as function

posted in JavaScript on 2017-12-01   ischristmas user state function children component props greeting redux userdataprovider jsx

If you are writing React applications you probably know about higher order components or render props (which by the way I think is kind of a form of higher order component pattern). In both cases we have a component that encapsulates logic and passes props down to children. Recently at work we came to the idea that we may push this further and represent some functionalities which are out of React in the same fashion - with a single tag in our components tree.

read more

Children in JSX

posted in JavaScript on 2017-01-06   todo header component return props children function todos classname todolist title

(This article is part of React in patterns series.)

React is highly composable. And the API that enables that is props.children. It gives us the power to create a placeholder that is later filled with content from the outside.

read more

CSS: Understanding first-child, last-child and nth-child

posted in CSS3 on 2013-08-16   child element nth child scope row4 markup type color styles

I like the CSS only solutions. Very often I need to select a specific DOM element. Sure I could add a new class, but it is always nice if I can do that inside my stylesheets. It just looks better and keeps my HTML markup clean. first-child, last-child and nth-child are made exactly for this purpose.

read more

5 useful ActionScript 3 tips

posted in ActionScript on 2011-05-24   movie color function date movie getchildat month number return tips

Sometimes, when you work on some project, you find something that is small, but very interesting and useful. Usually I'm adding such kind of things in classes that I like to call helpers. The following tips are part of my helpers.

read more

AS3: converting XML to JSON object

posted in ActionScript on 2011-04-02   label url image xml id img cdata node var version xml2json class http site int childnode object

I'm absolutely sure that you are using external data in your flash/flex applications. It is a good practice to transfer information in XML format. Most of the projects that I'm working on also use XML and in most of them I have a class that converts the data to JSON object. The problem with this workflow is that the parser's logic is always different because the XML is different. These days I wrote a class that solved this problem and directly converted every given XML file to a JSON object.

read more

OOP in JavaScript (part 2)

posted in JavaScript on 2011-02-22   child function parent prototype getname superclass parentclass childclass prototype extend child parent getname function return

I already wrote an article on this topic (Object Oriented Programming in JavaScript (Extending / Inherit classes)), but last few days I realized that there are some things that I didn't explain.

read more

CSS: selecting a specific child

posted in Other on 2011-01-05   span css main span specific child style set

The selectors are one of the most powerful features in CSS. Sometimes they can save you a lot of additional work. In this article I'll show you how to set the style of a specific child in a list of elements.

read more

Object Oriented Programming in JavaScript (Extending / Inherit classes)

posted in JavaScript on 2010-12-23   function baseclass class childclass var getname subclass2 subclass1 extend

As you probably know JavaScript is not exactly OOP based language. Of course there are some ways to handle with this and you can still create classes and inherit them. It is much much better to use classes. Your application will be well structured and split to modules.

read more

Flex: tabbing bug

posted in ActionScript on 2009-09-29   swf jeff depascale attach swf jeff deactivate attach swf focusmanager deactivate attach tabenabled focusmanager deactivate tabchildren tabenabled focusmanager tabindex tabchildren tabenabled set tabindex tabchildren flex set tabindex embed flex set tab ordering swf swf embed flex
read more