Skip to content

Instantly share code, notes, and snippets.

{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"bracketSpacing": false,
"jsxBracketSameLine": true,
"singleQuote": true,
"trailingComma": "none"
}
process.env.NODE_ENV = 'production'
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const webpackConfigProd = require('react-scripts/config/webpack.config.prod')
webpackConfigProd.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'report.html'
})
import { marbles } from "rxjs-marbles/jest";
import { map, startWith, scan } from "rxjs/operators";
import { Subject, merge, of } from "rxjs";
describe("basic", () => {
it(
"should update state by calling the handler as expected",
marbles(m => {
const createHandler = () => {
const stream$ = new Subject();

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('interpolate-html-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
@vire
vire / machine.js
Created September 16, 2022 12:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions