Skip to content

Instantly share code, notes, and snippets.

Евгений LopatkinEvgeniy

Block or report user

Report or block LopatkinEvgeniy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sebmarkbage
sebmarkbage / Enhance.js
Last active Oct 19, 2019
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@joaoneto
joaoneto / login.test.js
Created Mar 13, 2013
Login session test with mocha
View login.test.js
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')
@jhurliman
jhurliman / mutex.js
Created Jul 14, 2012 — forked from elarkin/Mutex.js
A simple mutex library for node.js
View mutex.js
var EventEmitter = require('events').EventEmitter;
module.exports = function() {
var queue = new EventEmitter();
var locked = false;
this.lock = function lock(fn) {
if (locked) {
queue.once('ready', function() { lock(fn); });
} else {
You can’t perform that action at this time.