New API
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
| /*! normalize.css v2.0.1 | MIT License | git.io/normalize */ | |
| /*! modified by Josh Vermaire to remove support IE8-9 */ | |
| /* ========================================================================== | |
| HTML5 display definitions | |
| ========================================================================== */ | |
| /* | |
| * Prevents modern browsers from displaying `audio` without controls. | |
| * Remove excess height in iOS 5 devices. |
| const md5File = require('md5-file'); | |
| const path = require('path'); | |
| // CSS styles will be imported on load and that complicates matters... ignore those bad boys! | |
| const ignoreStyles = require('ignore-styles'); | |
| const register = ignoreStyles.default; | |
| // We also want to ignore all image requests | |
| // When running locally these will load from a standard import | |
| // When running on the server, we want to load via their hashed version in the build folder |
| import React from 'react'; | |
| import { connect } from 'react-redux'; | |
| class PageWidget extends React.Component { | |
| componentDidMount() { | |
| this.ifr.onload = () => { | |
| this.ifr.contentWindow.postMessage('hello', '*'); | |
| }; | |
| } |
| import React from "react"; | |
| import { Helmet } from "react-helmet"; | |
| export default () => ( | |
| <div> | |
| <Helmet> | |
| <title>Ideas || MysiteName</title> | |
| <meta name="keywords" content="HTML,CSS,JavaScript" /> | |
| <meta | |
| name="description" |
| // set it up | |
| firebase.storage().ref().constructor.prototype.putFiles = function(files) { | |
| var ref = this; | |
| return Promise.all(files.map(function(file) { | |
| return ref.child(file.name).put(file); | |
| })); | |
| } | |
| // use it! | |
| firebase.storage().ref().putFiles(files).then(function(metadatas) { |
| const response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`) | |
| const data = await response.json() | |
| return data.imageUrl | |
| } |
| import React, { Component } from "react"; | |
| import { render } from "react-dom"; | |
| import "./index.css"; | |
| class Widget extends Component { | |
| state = { text: "" }; | |
| handleChange = (e) => { | |
| this.setState({ text: e.target.value }); | |
| }; | |
| render() { |
| import React, { Component } from 'react'; | |
| import extend from 'lodash/extend'; | |
| import { SearchkitManager,SearchkitProvider, | |
| SearchBox, Pagination, HitsStats, NoHits, ViewSwitcherHits, | |
| Layout, TopBar, LayoutBody, LayoutResults, | |
| ActionBar, ActionBarRow, QueryAccessor} from 'searchkit'; | |
| import './index.css'; | |
| import { | |
| SearchkitAutosuggest, HierarchicalRefinementDatasource, |