New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

shaco-router

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shaco-router - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

README.md

28

babel/component.js

@@ -6,2 +6,19 @@ import Shaco from 'shadow-component'

let RouterLink = Shaco.ComponentFactory({
elementName: 'route-link',
template: `
<content></content>
`,
to (e) {
e.preventDefault()
HistoryManager.push(this.state.to)
},
view () {
Shaco.createElement('a', null, null, {
href: this.state.to,
onclick: this.to.bind(this)
}, this.state.child)
}
})
let RouterSelector = Shaco.ComponentFactory({

@@ -67,11 +84,2 @@ elementName: 'route-selector',

},
renderChild(child = this.state.child) {
if (typeof child === 'function') {
return child();
} else if (Array.isArray(child)) {
child.forEach(this.renderChild);
} else {
return child;
}
},
renderRouteComponent () {

@@ -85,3 +93,3 @@ let selectedRoute = this.getComponentForRoute()

view: function () {
this.renderChild()
this.renderChildren()
this.renderRouteComponent()

@@ -88,0 +96,0 @@ }

{
"name": "shaco-router",
"version": "0.0.1",
"version": "0.0.2",
"description": "Component to deal with history changes with shaco",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,2 +21,17 @@ 'use strict';

var RouterLink = _shadowComponent2.default.ComponentFactory({
elementName: 'route-link',
template: '\n <content></content>\n ',
to: function to(e) {
e.preventDefault();
_history_manager2.default.push(this.state.to);
},
view: function view() {
_shadowComponent2.default.createElement('a', null, null, {
href: this.state.to,
onclick: this.to.bind(this)
}, this.state.child);
}
});
var RouterSelector = _shadowComponent2.default.ComponentFactory({

@@ -77,13 +92,2 @@ elementName: 'route-selector',

},
renderChild: function renderChild() {
var child = arguments.length <= 0 || arguments[0] === undefined ? this.state.child : arguments[0];
if (typeof child === 'function') {
return child();
} else if (Array.isArray(child)) {
child.forEach(this.renderChild);
} else {
return child;
}
},
renderRouteComponent: function renderRouteComponent() {

@@ -98,3 +102,3 @@ var selectedRoute = this.getComponentForRoute();

view: function view() {
this.renderChild();
this.renderChildren();
this.renderRouteComponent();

@@ -101,0 +105,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc