Clone DataCollection

Hello!
Is there an easy way to clone DataCollection?
My use case - I want to make one request for data, and work with this data in two independent components.
In addition, I need to have the access to initial configuration of the store to have possibility to make request to the server at any point in time.

The only solution I see now is to use “importData” and try to copy “by hand” all relevant properties from the original Store (which is not so easy).

https://snippet.webix.com/0wpyzvoi

And one more question - whether there is a way not to make a request to the server immediately when calling “new webix.DataCollection”, but delayed, say, when calling the method “startLoad” or something like this …

if you do not need deep clone then try to use serialize.
but in case of remote loading you need to use it with waitData

var store = new webix.DataCollection({
    url: "remote_url"
});
var clone = store.waitData.then(()=>{
    return store.serialize()
});

https://snippet.webix.com/8lc41zwo
do not use dynamic loading in DataCollection
AFAIK it will not work

@integral
Thank you for the advice. As I wrote above - “The only solution I see now is to use “importData” and try to copy “by hand” …”.
As far as I understand, the same result will be achieved.

But in my opinion, the hardest thing to do is to copy the configs of the store.

https://snippet.webix.com/huzy2srj

P.S. I’m not using the standard DataCollection, but a slightly advanced(+some helpers), so I need a whole store, not just data.

Up.

This is the first attempt to make cloning without affecting the work of the framework.

https://snippet.webix.com/hszqungp