Skip to content

Instantly share code, notes, and snippets.

View oviava's full-sized avatar

Ovidiu Avasilcai oviava

View GitHub Profile
@oviava
oviava / test.js
Last active September 18, 2016 08:58
class Input extends Component {
constructor() {
this.state = {
value: 0,
isValid: true,
};
}
changeHandler = (event) => {
// do stuff
@oviava
oviava / redux-dock-handlekey.js
Created November 4, 2015 10:20
works on chrome, not on firefox ( event is not defined )
handleKeyDown(e) {
if (!e.ctrlKey) {
return;
}
e.preventDefault();
const key = event.keyCode || event.which;
const char = String.fromCharCode(key);
switch (char.toUpperCase()) {
case this.props.toggleVisibilityKey.toUpperCase():
var path = require('path');
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: [
'./app/index.js'
],
@oviava
oviava / redux-socket.jsx
Last active November 12, 2017 05:24
handling socket events with redux
const types = {
ADD_TODO: 'ADD_TODO',
DELETE_TODO: 'DELETE_TODO',
COMPLETE_TODO: 'COMPLETE_TODO',
};
const socketEvents = {
ADD_TODO_SUCCESS: 'ADD_TODO_SUCCESS',
ADD_TODO_FAIL: 'ADD_TODO_FAIL',
};