Giter Site home page Giter Site logo

cherrytree-for-knockout's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cherrytree-for-knockout's Issues

Reduce flicker

Currently all routeView binding handlers have a dependency on activeRoutes, so during a transition, that is bulk replaced, causing the entire tree to re-render. A transition at depth 3 to another sibling should not cause depth 1 and 2 to rerender. We need to do deep comparisons before attempting to call component.init.

Also in general there may be resolve promises that are resolved already, but will still be async and resolve on the next tick - flickering over to route-loading during that time is a bad experience. This might be solved with the solution to the above problem.

Update query params after any potential disposals?

Sometimes views that are about to be disposed anyways will have their bound querystring parameterss updated only to be thrown away immediately thereafter. This should be done after any route view model changes (additions/removals), unless there is a gotcha or adverse effect.

Cherrytree for KO and RequireJS example

Hello Nathan,

I was trying to use cherrytree using require but I am having some problems. I was wondering if you could help me out.

the versions I am running are:

  • cherrytree 2.3.1
  • cherrytree-for-ko 0.5.2

this is my main class

requirejs(['knockout', 'cherrytree', 'pages/home/home',
'components/greeting', 'cherrytree-for-knockout'], function (ko, cherrytree, homeComponent, greetingComponent, cherrytreefoko) {

    ko.components.register('home', homeComponent);
    ko.components.register('greeter', greetingComponent);

    router = cherrytree();

    router.map(function (route) {
        route('home', homeComponent);
    })

    router.use(ko.bindingHandlers.routeView.middleware);
    router.listen();

    ko.applyBindings({ router: router }, document.querySelector('main'));
});
<main data-bind="routeView: router"></main>

the problem that is on the console says:
Uncaught (in promise) TypeError: Cannot read property 'name' of undefined(โ€ฆ) in this line:
middlewareName = router.middleware[i].name || 'anonymous'; of cherrytree.js

It seems that I am not able to load the middleware.

Thanks a lot Nathan.

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.