Skip to content

Instantly share code, notes, and snippets.

@hawkrives
Last active October 6, 2024 18:28
Show Gist options
  • Select an option

  • Save hawkrives/6e254f296aa70ad5273d to your computer and use it in GitHub Desktop.

Select an option

Save hawkrives/6e254f296aa70ad5273d to your computer and use it in GitHub Desktop.
"use strict";
var React = require('react');
var Router = require('react-router');
var Link = Router.Link;
var Index = React.createClass({
mixins: [ Router.State ],
render: function () {
var name = this.getPath();
var keys = Object.keys(localStorage);
document.querySelectorAll("synapse-index-list").innerHTML = keys;
return (
<div>
<div className="index-list">
{keys.map(function(key, i) {
return <li><Link key={i} to={key}>key</Link></li>
})}
</div>
</div>
);
}
});
module.exports = Index;
"use strict";
var React = require('react');
var Router = require('react-router');
var Link = Router.Link;
var Index = React.createClass({
mixins: [ Router.State ],
render: function () {
var name = this.getPath();
var keys = Object.keys(localStorage);
console.log(keys);
document.querySelectorAll("synapse-index-list").innerHTML = keys;
var list = [];
for (var i = 0 ; i < keys.length ; i++ ) {
var thisKey = "<li><Link to='" + keys[i] + "'>" + keys[i] + "</Link></li>";
list.push(thisKey[i]);
}
return (
<div>
<div className="index-list">
{list}
</div>
</div>
);
}
});
module.exports = Index;
"use strict";
var React = require('react');
var Router = require('react-router');
var Link = Router.Link;
var Index = React.createClass({
mixins: [ Router.State ],
getInitialState: function() {
return {
keys: []
}
},
loadData: function() {
var keys = Object.keys(localStorage);
this.setState({keys: keys})
},
componentWillMount: function() {
this.loadData()
},
componentWillRecieveProps: function() {
this.loadData()
},
render: function () {
var name = this.getPath();
return (
<div>
<div className="index-list">
{this.state.keys.map(function(key, i) {
return <li><Link key={i} to={key}>key</Link></li>
})}
</div>
</div>
);
}
});
module.exports = Index;
@tomassone396
Copy link

As someone who’s often juggling multiple deadlines, finding the right platform for buying research papers online has been a game changer. This article on the 6 best writing services offers great insights into trusted options. The breakdown of pricing, quality, and customer reviews helped me make an informed decision. It’s reassuring to know that these services prioritize originality and offer support through the entire writing process. For anyone overwhelmed with workload or needing extra help, this guide makes it easier to choose a service that suits individual needs without compromising on quality. Definitely worth checking out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment