componentDidUpdate(prevProps) {
if (!_.isEqual(prevProps.data, this.props.data)) {
this.props.loadData();
}
}
public function handle($request) {
// @var \Illuminate\Http\Response $response
$response = parent::handle($request);
// do anything you want with $response
return $response;
}
function crud(app, path, controller) {
app.get(path, controller.get);
app.post(path, controller.post);
app.delete(`${path}/:id`, controller.delete);
app.put(`${path}/:id`, controller.put);
}
class NotesController {
get(req, res) {
db.listNotes().then(data => res.send(data));
}
post(req, res) {
db.createNote(req.body).then(data => res.send(data));
}
delete(req, res) {
db.deleteNote(req.params.id).then(data => res.send(data));
}
put(req, res) {
db.updateNote(req.params.id).then(data => res.send(data));
}
}
crud(app, '/notes', new NotesController);
crud(app, '/users', new UsersController);
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
passport.use(new LocalStrategy({
usernameField: 'remodal[email]',
passwordField: 'remodal[password]'
}, function(username, password, callback) {
console.log(username, password);
}));
app.post('/login', passport.authenticate('local', {
successRedirect: '/',
failureRedirect: '/login'
}));
e.preventDefault();
link.addEventListener('click', function (e) {
e.preventDefault();
});
link.addEventListener('click', function (e) {
this.href = 'example.com';
});
({
shouldDeps: [
{ elem: 'control'},
{ elem: 'content'},
{ mods: { action: 'article'} },
{ block: 'modal', mods : { theme : 'islands', autoclosable : true }},
'button',
'content',
'menu',
{ block: 'i-bem', elem: 'dom' }
]
}, { tech: 'js', mustDeps: { elem: 'content', tech: 'bemhtml' } })
if (loginfield.getText().equals(login)) {
System.out.println("That's right");
}
$('.elem-exp .js-svg-bar').countTo({
to: 70,
speed: 1000,
onUpdate: function (value) {
$(this).attr('percent', value);
}
});
list: function(callback) {
pool.getConnection(function(err, connection) {
connection.query( 'SELECT * FROM tasks', function(err, rows) {
callback(rows);
connection.release();
});
});
},
var tasks = require('./tasks');
var list = tasks.list(function (rows) {
console.log(rows);
});