const createViewModel = require("./main-view-model").createViewModel;
const Particle = require("nativescript-particle").Particle;
const particle = new Particle();

function onNavigatingTo(args) {
    const page = args.object;
    page.bindingContext = createViewModel();
    // const particle = new Particle(); // same even if you initialise it here
    console.log('Particle', particle);
}

exports.onNavigatingTo = onNavigatingTo;
