Skip to content

Instantly share code, notes, and snippets.

View thinklinux's full-sized avatar

Tihomir Valkanov thinklinux

  • Sofia, Bulgaria
View GitHub Profile
@thinklinux
thinklinux / dispatching-action-creators.js
Created October 16, 2019 13:14 — forked from markerikson/dispatching-action-creators.js
Dispatching action creators comparison
// approach 1: define action object in the component
this.props.dispatch({
type : "EDIT_ITEM_ATTRIBUTES",
payload : {
item : {itemID, itemType},
newAttributes : newValue,
}
});
// approach 2: use an action creator function
@thinklinux
thinklinux / convert-svgs.js
Last active April 9, 2019 10:53 — forked from stowball/convert-svgs.js
A node script to convert a a folder of SVGs in to React Native SVGs for https://github.com/stowball/react-native-svg-icon
/* eslint-disable no-console, no-shadow */
const exec = require('child_process').exec;
const fs = require('fs');
// const type = process.argv[2] || 'icons';
const path = `./assets/svgs/originals`;
const svgoOptions = {
plugins: [
{ collapseGroups: true },
{ convertPathData: true },
@thinklinux
thinklinux / index.ios.js
Created November 7, 2018 14:59 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';