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

Recreating Facebook's Recoil library

posted in JavaScript on 2020-07-12   recoil facebook state management mycoil facebook s recoil counter atoms atom component library formattedcountervalue selector key function javascript subscribers hook const return

This weekend I decided to play with the new kid on the block - Facebook's Recoil library for managing state. I did the trivial counter example to see how it works. It's pretty simple idea so I wondered how much it takes to replicate its features. I found the exact answer - 70 lines of code. Obviously, my implementation didn't cover everything but it was fun so I decided to share my findings.

(A side note: I did not look at the code of Recoil. I didn't want to be bias on how to write my version.)

read more

The return statement is not the end (but it should be)

posted in JavaScript on 2016-01-05   function format return result var defined function dosomething code var format function result var format return result var

Well, I kind of lied in the title of this article. Of course that it is the end of the function. Once we call return everything else after that is simply not executed. Ops … I did it again, I kind of lied again.

read more

Adobe\'s strategic transformation and the Flash Platform

posted in ActionScript on 2011-11-20   adobe adobe community read full article social connections touch interfaces fundamental transformation change innovation time devices

Adobe is in the midst of a fundamental transformation. We are transforming from software in boxes to solutions in the cloud, and to a world of touch interfaces on devices, and social connections everywhere. This is a time of both innovation and change for Adobe and for the Adobe community ...Read the full article here.

read more

A RobotLegs Book

posted in ActionScript on 2011-07-22   book robotlegs joel hooks finished information read

@Stray and @Joel Hooks finished their book for RobotLegs. Definitely it is something that you should read. More information here.

read more

AS3: dynamic text field to curve (TextField on an arcing path)

posted in ActionScript on 2011-05-04   text var curvedtext textformat number radius tf direction endangle startangle

[2]Most of the articles here are tightly connected to my daily work. As you probably know from one of my latest posts (runtime font loading/embedding) I worked a lot with texts these days. There was a request for producing curved text from a dynamic field. Of course it wasn't so easy to create such a feature. I wrote a simple class that did the job and I decided to share it.

read more

AS3: runtime font loading (embedding)

posted in ActionScript on 2011-04-25   font field loader import flash swf public static const format font_export_name string font_file_name class

Flash is wonderful technology and has many advantages. Before a couple of years it was really popuplar to use it for displaying fonts that are not installed on the user's machine. Flash is still powerfull tool for such kind of tasks. These days I worked on a project which had to use a lot of fonts. It wasn't possible to embed all of them so I decided to implement runtime embedding.

read more

AS3: Using custom Metadata in Flex (part 1)

posted in ActionScript on 2010-12-28   metadata public flex mycustomclass information metadata tags tag as3 flash utils describetype public function mycustomclass

I'm sure that you've already used metadata tags in your flex applications. There are several reserved keywords like [Bindable], [Embed], [Event] and so on (the full list is available here). The function of the metadata tags is to provide additional information to the flex compiler. For example information about embeding assets, dispatching events. This article doesn't explain how to use the default flex tags (you can learn that from here). It shows you how to create your own metadata tags and how to use them.

read more

Trace JSON object in AS3

posted in ActionScript on 2010-07-17   str description gettypeof o spaces var object information users

I'm absolutely sure that all of you are working with JSON objects. It's pretty helpful to be able to print them and find out what exactly they contain. I wrote a simple function that makes this possible.

read more