This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example - | |
// { category: 'Cloths', 'brand': 'Van H', collection: 'New' }.sortObject(['brand', 'category', 'collection']); | |
var sortingBasedOnArr = ['collection', 'brand', 'category']; | |
var targetObject = { category: 'Cloths', 'brand': 'Van H', collection: 'New' } | |
Object.prototype.sortObject = function(sortingArr) { | |
var targetObj = this; | |
var result = {} | |
if (!targetObj) { | |
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Main service worker controller | |
function ServiceWorkerController() { | |
this._toastsView = new ToastsView(); | |
this._register(); | |
}; | |
ServiceWorkerController.prototype._register = function() { | |
if (!navigator.serviceWorker) return; | |
var ServiceWorkerController = this; | |
var swUrl = "/${optportalName}/service-worker/service-worker.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "my-react-app", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"babel-plugin-react-css-modules": "^3.4.2", | |
"react": "^16.3.2", | |
"react-dom": "^16.3.2", | |
"react-scripts": "1.1.4" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File - src/App.js | |
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import Link from './Link'; | |
import styles from './App.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className={styles.App}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File - src/App.css | |
.App { | |
text-align: center; | |
} | |
.AppLogo { | |
height: 80px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import{ | |
Grid, Row, Col, | |
FormGroup, ControlLabel | |
} from 'react-bootstrap'; | |
import { Field, reduxForm } from 'redux-form' | |
import { renderInputField, required, email } from 'utils/form-helpers' | |
let SettingsForm = props => { | |
const { handleSubmit, submitting } = props |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
Route, | |
Switch | |
} from 'react-router'; | |
import Loadable from 'react-loadable'; | |
import AppLoader from './common/components/AppLoader'; | |
// Import modules/routes | |
import About from './about'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class App extends Component { | |
handleClick = () => { | |
import ('./moduleA') | |
.then(({ | |
moduleA | |
}) => { | |
// Use moduleA | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<main class="container"> | |
<div> | |
<header> | |
<h3>Archives</h3> | |
</header> | |
<div v-if="posts && posts.length" class="postsList"> | |
<ul class="row"> | |
<li v-for="(post, index) in posts" class="postItem col-sm-4"> | |
<div class="postContent"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ajax } from 'rxjs/observable/dom/ajax'; | |
import 'rxjs/add/operator/catch' | |
import { | |
REQUEST_USER_REPOS_START | |
} from '../actions/actionTypes'; | |
import { | |
doUserReposFulfilled, | |
doUserReposFailed | |
} from '../actions/doUserRepos'; |