http://twitter.com/share?text=<TITLE>&url=<URL>
E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com
http://www.facebook.com/sharer.php?u=&p[title]=
{ | |
"Console Log": { | |
"prefix": "log", | |
"body": ["console.log(Date.now(), '${1:text}', ${1:text})"], | |
"description": "Console Log" | |
}, | |
"Connect Redux": { | |
"prefix": ",con", | |
"body": ["import { connect } from 'react-redux'"], | |
"description": "Connect Redux" |
// importing basic redux packages | |
import { createStore, applyMiddleware, compose } from 'redux' | |
// importing our combined reducers | |
import combineReducers from '../reducers/index.reducers' | |
// importing our middleware | |
import { middlewareActions } from '../middleware/index.middleware' | |
// this is needed to be able to do ajax requests | |
import thunk from 'redux-thunk' | |
// the following line is used for the redux devtools chrome extension | |
const storeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose |
// our initial state | |
const initialState = { | |
data: {}, | |
isLoaded: false | |
} | |
const userReducer = (state = initialState, action) => { | |
if (action.type === 'USER_LOADED') { | |
return { | |
...state, // this copies the old state |
import axios from 'axios' | |
export function middlewareActions({ dispatch }) { | |
return next => action => { | |
if (action.type === 'USER_LOADED') { | |
dispatch({ | |
type: 'STATUS_CHANGED', | |
payload: true | |
}) | |
} |
import axios from 'axios' | |
export function loadUser() { | |
// this will be used to trigger the reducer | |
return { | |
type: 'LOAD_USER' | |
} | |
} | |
export function loadNews() { |
import React, { Component } from 'react' | |
import { loadUser } from './redux/actions/index.actions' | |
// this is what matters for redux | |
import { connect } from 'react-redux' | |
class User extends Component { | |
componentDidMount() { | |
if (!this.props.user.isLoaded) { | |
this.props.loadUser() | |
} |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import './styles.css' | |
import User from './User' | |
import News from './News' | |
import Status from './Status' | |
import { Provider } from 'react-redux' | |
import store from './redux/stores/index.stores' | |
function App() { |
var first = 'https://google.com'; | |
var second = 'https://bing.com'; | |
var third = 'https://duckduckgo.com'; | |
var fourth = 'https://yandex.com'; | |
var fifth = 'https://qwant.com'; | |
module.exports = { first, second, third, fourth, fifth }; |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |