Giter Club home page Giter Club logo

Comments (3)

arunoda avatar arunoda commented on July 29, 2024

I can see the usefulness. Let's see what we can do.
On 2015 මාර්තු 19, බ්‍රහස් at ප.ව. 7.51 Gabriel Almeida <
[email protected]> wrote:

As there are no hooks available, is there a way to replicate this behavior
below?

Router.onStop(function () {
IonScrollPositions[Router.current().route.getName()] = $('.overflow-scroll').scrollTop();
});

I mean, is there an easy way to run some sort of code right before a route
change? Middlewares aren't able to do that that because it runs only at the
initialization step and it's already lost previous route access.

Thanks


Reply to this email directly or view it on GitHub
#41.

from flow-router.

zimt28 avatar zimt28 commented on July 29, 2024

It would really be cool to have hooks and more powerful middleware (see #45, language rewrites).
Even though Flow doesn't come with a loading page, I like them in some cases. It's possible to do this without any problems:

FlowRouter.route('/post', {
  subscriptions: function() {
    this.register('post', Meteor.subscribe('post'));
  },
  action: function() {
    Tracker.autorun(function(c) {
      if (!FlowRouter.subsReady('post')) {
        FlowLayout.render('layout1', { main: 'loading' });
        return;
      }
      FlowLayout.render('layout1', { main: 'singlePost' });
      c.stop();
    });
  }
});

But it would be cool if we could just register ad hook/ plugin for those situation where we'd have to repeat so much code. I understand that we don't want to build a second iron:router here, but it's good to think about a minimal api which lets you do as much as possible.

from flow-router.

arunoda avatar arunoda commented on July 29, 2024

Let's carry over the discussion here: #59

from flow-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.