diff --git a/examples/.babelrc b/examples/.babelrc deleted file mode 100644 index 260b050..0000000 --- a/examples/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "plugins": ["transform-class-properties", "transform-object-rest-spread"], - "presets": ["es2017", "es2015", "react", "stage-0"] -} diff --git a/examples/.eslintrc.json b/examples/.eslintrc.json deleted file mode 100644 index 3bcb455..0000000 --- a/examples/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": ["airbnb"], - "globals": { - "fetch": false - }, - "rules": { - "semi": [2, "never"], - "arrow-body-style": 0, - "import/no-named-as-default": 0, - "import/prefer-default-export": 0, - "import/no-unresolved": 0 - } -} diff --git a/examples/.gitignore b/examples/.gitignore deleted file mode 100644 index 2e95fb0..0000000 --- a/examples/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release -public - -# Dependency directories -node_modules -jspm_packages - -# Optional npm cache directory -.npm - -# Optional REPL history -.node_repl_history diff --git a/examples/.sass-lint.yml b/examples/.sass-lint.yml deleted file mode 100644 index 4501e5c..0000000 --- a/examples/.sass-lint.yml +++ /dev/null @@ -1,34 +0,0 @@ -rules: - extends-before-mixins: 2 - extends-before-declarations: 2 - placeholder-in-extend: 0 - hex-notation: 2 - indentation: 2 - property-sort-order: 2 - variable-for-property: 2 - no-color-literals: 0 - clean-import-paths: 2 - hex-length: 2 - force-pseudo-nesting: 2 - force-element-nesting: 2 - quotes: 2 - class-name-format: 0 - empty-line-between-blocks: 2 - leading-zero: 2 - space-before-brace: 2 - space-before-bang: 2 - no-important: 0 - no-css-comments: 2 - no-color-keywords: 2 - space-after-colon: 2 - no-vendor-prefixes: 0 - border-zero: 2 - no-empty-rulesets: 2 - trailing-semicolon: 2 - no-duplicate-properties: 2 - shorthand-values: 2 - pseudo-element: 2 - single-line-per-selector: 2 - zero-unit: 2 - no-mergeable-selectors: 2 - no-qualifying-elements: 2 diff --git a/examples/LICENSE b/examples/LICENSE deleted file mode 100644 index d935ecb..0000000 --- a/examples/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Fabien JUIF - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/examples/package.json b/examples/package.json deleted file mode 100644 index b538b83..0000000 --- a/examples/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "hoc-react-loader-examples", - "version": "4.0.0", - "description": "", - "directories": { - "doc": "doc" - }, - "scripts": { - "start": "set NODE_ENV=development && webpack-dev-server --inline --hot --port=3000 --history-api-fallback", - "build": "NODE_ENV=production webpack --define process.env.NODE_ENV='\"production\"' -p ", - "lint": "eslint src --ext=jsx --ext=js && find ./src/ -iname \"*.scss\" -exec sass-lint -v --no-exit {} +", - "publish": "npm run build && node publish" - }, - "author": "Fabien JUIF", - "license": "MIT", - "devDependencies": { - "babel-core": "~6.7.5", - "babel-eslint": "~6.0.0", - "babel-loader": "~6.2.4", - "babel-plugin-syntax-class-properties": "~6.5.0", - "babel-plugin-transform-class-properties": "~6.6.0", - "babel-plugin-transform-object-rest-spread": "~6.6.5", - "babel-polyfill": "~6.7.4", - "babel-preset-es2015": "^6.9.0", - "babel-preset-es2017": "^1.4.0", - "babel-preset-react": "~6.5.0", - "babel-preset-stage-0": "~6.5.0", - "babel-register": "~6.7.2", - "chai": "~3.5.0", - "css-loader": "^0.23.1", - "eslint": "^3.2.2", - "eslint-config-airbnb": "^10.0.0", - "eslint-plugin-import": "^1.12.0", - "eslint-plugin-jsx-a11y": "^2.0.1", - "eslint-plugin-react": "^6.0.0", - "expect": "~1.16.0", - "file-loader": "~0.8.5", - "gh-pages": "^0.11.0", - "jsdom": "^9.4.2", - "mocha": "~2.4.5", - "node-sass": "^3.7.0", - "react-hot-loader": "~1.3.0", - "sass-lint": "^1.8.2", - "sass-loader": "^3.2.0", - "sinon": "~1.17.3", - "style-loader": "~0.13.1", - "webpack": "~1.12.2", - "webpack-dev-server": "~1.12.1" - }, - "dependencies": { - "hoc-react-loader": "file:../", - "lodash": "^4.15.0", - "normalize.css": "~4.2.0", - "prop-types": "^15.5.8", - "react": "15.3.0", - "react-dom": "15.3.0", - "react-highlight": "^0.8.0", - "react-ink": "^5.1.1", - "tinycolor2": "^1.4.1" - } -} diff --git a/examples/publish.js b/examples/publish.js deleted file mode 100644 index 31660bb..0000000 --- a/examples/publish.js +++ /dev/null @@ -1,12 +0,0 @@ -const ghpages = require('gh-pages') -const path = require('path') - -/* eslint-disable no-console */ -ghpages.publish(path.join(__dirname, 'public'), (err) => { - if (err) { - console.error(err) - } else { - console.log('Success') - } -}) -/* eslint-enable no-console */ diff --git a/examples/src/components/App.jsx b/examples/src/components/App.jsx deleted file mode 100644 index 5c2e483..0000000 --- a/examples/src/components/App.jsx +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react' - -/* eslint-disable import/no-extraneous-dependencies */ -import Icon from 'favicon.png' -/* eslint-enable import/no-extraneous-dependencies */ - -import Examples from './Examples' -import styles from './App.scss' - -const App = () => ( -
- This is a higher order component ("HOC"). - Its purpose is to call a
loadcallback passed through the
propsof - a component only once (at
componentWillMount). This is convenient to load - data from a backend for instance. The component shows a loading indicator when it's - waiting for the props to be defined. The loading indicator can be changed easily. - - -
- Check out the examples below. Use the button to trigger a stubbed loading. -
- -{code}
- - {buttons['0'] && `loaded: ${loaded ? 'true' : 'false'}\n`} - {buttons['1'] && `prop: ${prop || 'undefined'}\n`} - {buttons['2'] && `prop2: ${prop2 || 'undefined'}\n`} --
- In this example, the loader wraps a Component with -
this.props.loadeddefined. - It means that the loader calls
this.props.load- if presents, then waits for
this.props.loaded- to be truthy, and finally displays the wrapped components. - While waiting for
this.props.loaded- to be truthy, hoc-react-loader takes care of displaying - a spinner based on the background color. - -
- Like in the previous example, the default loading indicator is used (the spinner) and -
this.props.loadis called. But this time, the
HOCwaits for -
this.props.propas specified in the
- If the
hoc-react-loaderwill wait for all of the specified props to be truthy. - In this example, these are
propand
prop2. - -
- If the
truethe
hoc-react-loader- will not display the loading indicator (default or custom). - But
this.props.loadis still called if presents! - -
- In this example, the default loading indicator is replaced with a custom one. - The component waits for the default prop (
this.props.loaded). - -