How to implement pull-to-refresh

I built a news app with Fuse. But I need to implement pull-to-refresh and click-to-refresh. Can someone show me how to do that? Below is my code:

var Observable = require("FuseJS/Observable"); var moment = require('js/moment');
    var data = Observable();

    function Article(item) {
        this.title = item.thread.title; =;
        this.text = item.text,
        this.likes =;
        this.published = moment(item.thread.published).startOf('hour').fromNow();
        this.image = item.thread.main_image;

    .then(function(response) { return response.json(); })
    .then(function(responseObject) {
        var items = [];
        for (var i in responseObject.posts) {
            items.push(new Article(responseObject.posts[i]));
module.exports = {
		dataSource: data,
			getNewsDetail: function(args){

	<StackPanel Dock="Top" Color="#FF5061" Height="65" ux:Name="sidebarFade">
		<Panel Height="56" Margin="0, 15, 0, 10">
			<Panel Height="56">
				<Hamburger Alignment="Left">
						<NavigateToggle Target="sidebar" />
			<Text Value="News" Alignment="Center" Color="#FFF" FontSize="20" />
	<Loading />
	<ScrollView LayoutMode="PreserveVisual">		
	<StackPanel ItemSpacing="5">
			<Each Items="{dataSource}">
					<DockPanel Tapped="{getNewsDetail}">
						<Grid RowCount="1" ColumnCount="2" Margin="10">
						<Image Url="{image}" StretchMode="UniformToFill" MaxHeight="100" Margin="0, 0, 10, 0"/>
						<Image File="../Assets/placeholder2.png" StretchMode="UniformToFill" MaxHeight="100" Margin="0, 0, 10, 0"/>
						<StackPanel Padding="0, 10, 10, 10">
						<headerBg Alignment="Left" Padding="5,2,5,2" CornerRadius="2,2,2,2"><Text Value="{site}" TextWrapping="Wrap" Alignment="TopLeft" FontSize="12" Color="#ffffff"/>
						<Text Value="{title}" Font="OpenSans2" FontSize="13" TextWrapping="Wrap" Alignment="TopLeft" Margin="0, 5, 0, 0" />
						<Text Value="{published}" TextWrapping="Wrap" Alignment="TopLeft" FontSize="14" Color="Green"/>
					<Rectangle Layer="Background" Color="#fff" Margin="5,5,5,0">
						<Shadow Size="2" Distance="2" Color="#0003" />
	<Scrolled To="End" Within="300">

There’s an example of pull-to-reload here, which probably does what you want.