
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
shaco-router
Advanced tools
This is a component for Shaco that allow use the window.history to change the URL on the browser and render diferents components depending of the URL
const TodoContainer = Shaco.ComponentFactory({
elementName: 'todo-container',
template: `<content></content>`,
view: function () {
/*
* RouteManager: will allow render one component depending the URL in the browser.
*
* the routeIs function receive to params:
* Fist the pattern to match the URL, Example:
* This could be something like:
* "/" -> the index
* "/tasks"
* "/tasks/:id"
* ".*" -> the rest
* The second parameter is and array that will be past to Shaco.createElement. You don't add the state here
* The State will be passed to all the components inside the router-manager
* You can use router-manager using JSX like before or using javascript functions, like this:
*
*/
// With Javascript functions (normal Shaco components)
// Shaco.createElement('route-manager', null, this.state, {}, () => {
// Shaco.createElement('route-selector', null, { pattern: '/', params: ['todo-app', null]} )
// Shaco.createElement('route-selector', null, { pattern: '.*', params: ['div', null, {}, "Not found"]} )
// })
// With JSX
return (
<route-manager state={this.state}>
<route-selector state={{ pattern: '/', params: ['todo-app', null] }}></route-selector>
<route-selector state={{ pattern: '.*', params: ['div', null, {}, "Not found"]}}></route-selector>
</route-manager>
)
}
})
FAQs
Component to deal with history changes with shaco
The npm package shaco-router receives a total of 0 weekly downloads. As such, shaco-router popularity was classified as not popular.
We found that shaco-router 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.