This time, instead of the article, it was decided to make a video explaining three important aspects of the API Matryoshka. This is a pilot video, and, if there is a positive reaction from the community, plans to record several video tutorials, presumably in the format of "X in 60 seconds."
The video tells about:
1. A method implementing one / two-way data binding ( bindNode ). 2. Dependencies of some data on others ( calc ). 3. Ability to listen for property changes to run arbitrary code. ')
The nested doll is sometimes criticized for the method that was chosen for data binding and presentation. To be more precise, the developers are challenged by the bindNode method and the use of a selector instead of newfangled components or the description of logic right in the HTML code.
this.bindNode('key', '.selector', binder);
The video has the answer to this question: a view is nothing more than a source of data, events, and a way to output data to a document. The advantage of this approach is that you do not bother with the presentation, but work with the data, without thinking what will happen when the data changes. This also applies to collections, including (nothing is said in the video about working with collections). You specify several rules and, when the collection changes, the view itself responds, and the application logic is contained in event handlers that react to changes.
The framework was created thanks to the usual laziness and unwillingness to keep a lot of everything in my head. Applications are created sequentially, step by step, in the same way as cells in tabular processors are described: A depends on B; B depends on C; A does not know what determines B; C does not know what depends on B. Instead of A, B, C, you can substitute both the view and the data.
In addition, with Matryoshka, you can first describe everything that is responsible for the data, without thinking about where they will come from (from the code, from the view, from the console) and where they will then get (into the view, into the handler, etc.), and then describe the banding. It's damn convenient.