Coder Social home page Coder Social logo

hash-route's Introduction

hash-route v2.0.3

CircleCI codecov

A router tool based on decorator and hash string.

Usage

You can register the route by @route decorator.

Note: You can put string literal at the method name position in es2015.

const {route, dispatch} = require('hash-route')

class Router {
  constructor () {
    $(window).on('hashchange', () => dispatch(this))
  }

  @route '#' () {
    location.replace('#projects')
  }

  @route '#projects' () {
    showAllProjectPage()
  }

  @route '#projects/:project' (params) {
    showProjectPage(params.project)
  }

  @route '*' () {
    showNotFoundPage()
  }

  ...
}

With the above example, each time the hash string changed the registered routes are compared with location.hash and if it matches, the corresponding route (method) is invoked.

The express style patterns are available as route paths. This library uses path-to-regexp under the hood. See its document for available patterns.

Install

npm install hash-route

License

MIT

hash-route's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

hash-route's Issues

An in-range update of watchify is breaking the build 🚨

The devDependency watchify was updated from 3.11.0 to 3.11.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

watchify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 8 commits.

  • c3fe218 3.11.1
  • e90101b Merge pull request #362 from digipost/upgrade-deps
  • d163b4f upgrade dependencies: fix errors from npm audit
  • 1917270 Merge pull request #351 from menzow/feature/update-docs
  • d232754 Merge pull request #357 from Kamil93/patch-1
  • d924e9b Update readme.markdown
  • 9ea8a65 Support for working with transforms
  • 8147bc5 Add troubleshooting information for silenced errors

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of uglify-js is breaking the build 🚨

The devDependency uglify-js was updated from 3.6.1 to 3.6.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

uglify-js is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for v3.6.2

Β 

Commits

The new version differs by 9 commits.

  • c3ca293 v3.6.2
  • 516b67a minor tweaks to CI test scripts (#3467)
  • eba3a37 fix boolean context detection (#3466)
  • 6d57ca1 improve source map handling (#3464)
  • 3320251 update benchmark URLs (#3462)
  • 33c94d3 detect boolean context across IIFEs (#3461)
  • b18f717 improve readability of --help ast (#3460)
  • a0d4b64 remove extraneous property (#3459)
  • 6db880e clean up AST_Binary optimisation logic (#3458)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of karma is breaking the build 🚨

Version 1.5.0 of karma just got published.

Branch Build failing 🚨
Dependency karma
Current Version 1.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As karma is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details
Release Notes v1.5.0

Bug Fixes

  • filter browser logging by level of LOG (89a7a1c), closes #2228
  • make window.parent.karma available in debugged context (3e7eaeb)
  • client: don't crash if receive array-like results (e095411), closes #2061

Features

  • add an option to run the tests by dynamically loading test scripts without iframe (aa42c41)
  • add support for node@7 (eb407ab), closes #2559
Commits

The new version differs by 18 commits .

  • cc6accd chore: release v1.5.0
  • 8b78aa5 chore: update contributors
  • 153880f chore: upgrade dev dependencies
  • e095411 fix(client): don't crash if receive array-like results
  • 89a7a1c fix: filter browser logging by level of LOG
  • eaeffe9 docs(config): update note on config languages to include TypeScript
  • b40af7e docs(dev): fix browsers_ready event heading level
  • aa42c41 feat: add an option to run the tests by dynamically loading test scripts without iframe
  • eb407ab feat: add support for node@7
  • 18757e6 Merge pull request #2555 from karma-runner/greenkeeper-supertest-3.0.0
  • 01b35c4 docs(config): fix typescript comment syntax
  • e7dd612 Merge pull request #2564 from dryajov/master
  • 6a7a22f Merge pull request #2561 from danielcompton/docs-commit-msg-example
  • 3e7eaeb fix: make window.parent.karma available in debugged context
  • 7f55f4f docs(contributing): add sample commit message

There are 18 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of karma is breaking the build 🚨

The devDependency karma was updated from 3.1.1 to 3.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for v3.1.2

Bug Fixes

Features

Commits

The new version differs by 11 commits.

  • 7d4d347 chore: release v3.1.2
  • 5077c18 chore: update contributors
  • fb05fb1 fix(server): use flatted for json.stringify (#3220)
  • 2682bff feat(docs): callout the key debug strategies. (#3219)
  • 4e87902 fix(changelog): remove release which does not exist (#3214)
  • 30ff73b fix(browser): report errors to console during singleRun=false (#3209)
  • 5334d1a fix(file-list): do not preprocess up-to-date files (#3196)
  • dc5f5de fix(deps): upgrade sinon-chai 2.x -> 3.x (#3207)
  • d38f344 fix(package): bump lodash version (#3203)
  • ffb41f9 refactor(browser): log state transitions in debug (#3202)
  • 240209f fix(dep): Bump useragent to fix HeadlessChrome version (#3201)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of browserify is breaking the build 🚨

Version 14.2.0 of browserify just got published.

Branch Build failing 🚨
Dependency browserify
Current Version 14.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As browserify is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details
Commits

The new version differs by 5 commits .

  • 18e1d65 14.2.0
  • 0e1a7a0 add cli support for --transform-key to support mode's like production/staging/etc..
  • a5aa660 Merge pull request #1701 from wogsland/doc-fix
  • ae281bc Fixed documentation formatting that was bugging me
  • fe8c57b async test for node 7

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.5.5 to 7.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.