title: How to update nativescript radlistview with new items at intervals
body: <p>i'm creating a nativescript core app with radlistview and i would like the listview to add new items automatically at intervals.</p>
  <p>if you have any knowledge of how i can achieve this, please help, i would appreciate.</p>
  <p>this is my view-model.js</p>
  <pre><code>_sourceDataItems: new ObservableArray(),
      dataItems: new ObservableArray(),
      initDataItems: function () {
              var url=&quot;example.com&quot;;
              fetch(url).then((response) =&gt; response.json()).then((res) =&gt; {
              var count = res.items.length;
              this._sourceDataItems = res.items;
              this.addMoreItemsFromSource(5);
              }).catch((err) =&gt; {
  
              });
        },
        addMoreItemsFromSource: function (chunkSize) {
          console.log(this._sourceDataItems);
          let newItems = this._sourceDataItems.splice(0, chunkSize);
            this.dataItems.push(newItems);
        },
        
        onLoadMoreItemsRequested: function (args) {
          console.log(&quot;---load more item---&quot;);
          const that = new WeakRef(this);
          const listView = args.object;
          if (this._sourceDataItems.length &gt; 0) {
            setTimeout(function () {
              that.get().addMoreItemsFromSource(25);
              listView.notifyLoadOnDemandFinished();
            }, 1500);
            args.returnValue = true;
          } else {
            args.returnValue = false;
            listView.notifyLoadOnDemandFinished(true);
          }
        },       
    });
   
  </code></pre>
  <p>if you need anymore info, let me know</p>