
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
router-view
Advanced tools
Location bar is a view of store
This project is based on react and immutable-js.
Demo http://router-view.mvc-works.org/
In time travelling debugger, router is not controlled. So I suggest location bar being regarded as a view of store in order to be controlled.
npm i --save router-view
Addressbar = require 'router-view'
pathUtil = require 'router-view/lib/path'
rules = pathUtil.expandRoutes [
['home', '/']
['demo', '/demo']
['skip', '/skip/~']
['team', '/team/:teamId']
['room', '/team/:teamId/room/:roomId']
['404', '~']
]
oldAddress = "#{location.pathname}#{location.search}" # for history API
# oldAddress = location.hash.substr(1) # for hash
router = pathUtil.getCurrentInfo rules, oldAddress
store = store.set 'router', router
Addressbar
route: store.get('router')
rules: routes
onPopstate: (info, event) ->
inHash: false # fallback to hash from history API
skipRendering: false # true to allow model/view inconsistency during loading
~ refers to "any path" in this library.
And in store the route information (info) is like:
name: 'room'
data:
teamId: '12'
roomId: '34'
query:
isPrivate: 'true'
Parameters and querystrings are supported. Get this from store and render the page.
router-view is totally based on immutable-js.skipRendering to true during loadingundefined value is eliminated on purpose, fire an issue if you think differenly.MIT
FAQs
Router view for React
The npm package router-view receives a total of 35 weekly downloads. As such, router-view popularity was classified as not popular.
We found that router-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.