Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Andrey Gubanov
@finom
@Thundechile thank you for great feedback. Matreshka uses simple prototype-based OOP so you can unit-test it the same way you test simple JS functions or classes.
it('does something awesome', function() {
    var instance = new MyClass();
    expect(instance.x).toEqual(42);
});
Andrey Gubanov
@finom
@Thundechile let me know is it the answer.
tkivela
@tkivela
@finom Yes the testing is that easy, thank you for the example! I think that kind of short example would also be a good to mention in the documentation?
Andrey Gubanov
@finom
@Thundechile OK, will add it to FAQ
Andrey Gubanov
@finom
@/all balalaika will be renamed to something else in a new version of Matreshka because there is only 10% of original balalaika code.
The one idea is to call it bQuery. If you have other ideas, you're welcome.
Andrey Gubanov
@finom
Hay guys, just created a page on Facebook: https://www.facebook.com/matreshkajs
Kristian
@kethomassen
@finom Can you suggest the best way to sync data between two arrays, besides manually waiting for modify events?
Andrey Gubanov
@finom
@kethomassen hmm, no better ideas
But you can create another method via prototypes if you don't need to make it every time.
Matreshka.Array.prototype.syncWith = function(array) {
  // ...
};
this.syncWith(arr);
Alexey Kinev
@rudyryk
Hi everyone! :)
Andrey Gubanov
@finom
Hey
Andrey Gubanov
@finom
Hey Guys! The new version is released: https://github.com/matreshkajs/matreshka/releases
Happy holidays.
Andrey Gubanov
@finom

@/all what do you think about the following?

Sometimes an app requires something better than once method. My proposition is to make when function which returns a promise instead of calling a callback.

this.when('change:a')
    .then(function() {
        doSomething();
    });

The syntax above is not so interesting but asynchronous functions allow to make fantastic things.

await this.when('change:a');
doSomething();
Andrey Gubanov
@finom
This is the implementation of when:
MK.prototype.when = function(name) {
    return new Promise(resolve => this.once(name, resolve));
};
Andrey Gubanov
@finom

Another little usecase using async functions:

this.bindNode({window});
if(document.readyState != 'complete') {
    await this.when('load::window');
}
doSomething();

This code checks is window already loaded. If not it's waiting for load event.

Anatoly I
@blackbeam
Any plans to maintain typescript definitions?
Andrey Gubanov
@finom
@blackbeam not yet
Andrey Gubanov
@finom
@/all the new version is released: https://github.com/matreshkajs/matreshka/releases
Andrey Gubanov
@finom
And 1.7.0 is arrived as well.
Andrey Gubanov
@finom
Do you need some reactive routing? Here you go: https://github.com/matreshkajs/matreshka-router
Andrey Gubanov
@finom
Hey guys, check out the new feature: https://matreshka.io/#!Matreshka.binders.dropFiles
Is anybody alive? I'm not sure should I post news to this chat.
Denis
@grammakov
:shipit:
Andrey Gubanov
@finom
@grammakov sorry, this is not an answer :)
Denis
@grammakov
@finom kind of is! At least I showed that someone IS alive :smile:
Andrey Gubanov
@finom
@grammakov :)
But I mean should I post news here?
Andrey Gubanov
@finom
This message was deleted
schtanislau
@schtanislau
Hey guys
http://matreshkajs.github.io/matreshka_todomvc/ Is this sample app actually working??
Andrey Gubanov
@finom
@schtanislau thanks, it works now
schtanislau
@schtanislau
@finom Cool, thank you!
Andrey Gubanov
@finom
@/all some news about v2 matreshkajs/matreshka#34
Jeff Wainwright
@yowainwright
Checking it out now.
Andrey Gubanov
@finom
@yowainwright :)
Jai Agrawal
@jaiag10
thought about creating a playground?
Andrey Gubanov
@finom
@jaiag10 nope
Grigoriy Sushkov
@sussh
Привет.
  1. создал новый проект
  2. выполнил npm install --save matreshka
  3. скопировал пример "Hello World"
    не пашет . Ибо не находит <script src="matreshka.min.js"></script>
    покопал в node_modules/* действительно такого нету
    что делаю не так?
Andrey Gubanov
@finom
@sussh answered you there
Andrey Gubanov
@finom
this.calc('response', 'data', async (data) => {
    const resp = await fetch(url, {
        method: 'post',
        body: data
    });

    return resp.json();
});
Andrey Gubanov
@finom
@/all check out a hard-form of Matreshka.js https://github.com/defijs/defi
Vladimir Gamalyan
@vladimirgamalyan
Hello guys!
BTW, is it possible to break lines in the message?