Coder Social home page Coder Social logo

Comments (6)

TehShrike avatar TehShrike commented on May 4, 2024

The state router will emit a stateChangeError event that you can handle: https://github.com/TehShrike/abstract-state-router/blob/master/index.js#L321

This doesn't appear to be documented under events yet! :-x

from abstract-state-router.

TehShrike avatar TehShrike commented on May 4, 2024

If you're talking about someone manually editing the url to something invalid, that isn't handled at the moment. That should probably be implemented by adding something like

stateRouterOptions.router.setDefault(function(path, parameters) {
  stateProviderEmitter.emit('routeNotFound', path, parameters)
})

Router method: https://github.com/TehShrike/hash-brown-router/#routersetdefaultcb---set-a-default404-route

A pull request with a test/implementation would be appreciated, otherwise I'll get to this at some point.

from abstract-state-router.

AgentChris avatar AgentChris commented on May 4, 2024

Hey, I've managed to fix my problem using this solution:
#61
Thanks for the project by the way I'm using it for my riotjs project and it is great ;)

from abstract-state-router.

TehShrike avatar TehShrike commented on May 4, 2024

Failed test added in 17f5a3c and fixed by f3e2fbd and published as 15.12.0! Let me know what you think.

from abstract-state-router.

TehShrike avatar TehShrike commented on May 4, 2024

...and some more documentation added in 71c3304

from abstract-state-router.

AgentChris avatar AgentChris commented on May 4, 2024

works perfectly thanks 👍

from abstract-state-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.