This file contains hidden or 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 compose from './compose' | |
| import { Middleware, MiddlewareAPI } from './types/middleware' | |
| import { AnyAction } from './types/actions' | |
| import { StoreEnhancer, StoreCreator, Dispatch } from './types/store' | |
| import { Reducer } from './types/reducers' | |
| export default function applyMiddleware( | |
| ...middlewares: Middleware[] | |
| ): StoreEnhancer<any> { | |
| return (createStore: StoreCreator) => <S, A extends AnyAction>( |
This file contains hidden or 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 $$observable from './utils/symbol-observable' | |
| import { | |
| Store, | |
| PreloadedState, | |
| StoreEnhancer, | |
| Dispatch, | |
| Observer, | |
| ExtendState | |
| } from './types/store' |
This file contains hidden or 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
| // functions | |
| import createStore from './createStore' | |
| import combineReducers from './combineReducers' | |
| import bindActionCreators from './bindActionCreators' | |
| import applyMiddleware from './applyMiddleware' | |
| import compose from './compose' | |
| import warning from './utils/warning' | |
| import __DO_NOT_USE__ActionTypes from './utils/actionTypes' | |
| // types |
This file contains hidden or 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
| export interface BackdropProps | |
| extends StandardProps< | |
| React.HTMLAttributes<HTMLDivElement> & Partial<FadeProps>, | |
| BackdropClassKey | |
| > { | |
| /** | |
| * If `true`, the backdrop is invisible. | |
| * It can be used when rendering a popover or a custom select component. | |
| */ | |
| invisible?: boolean; |
This file contains hidden or 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
| Icon.propTypes = { | |
| /** | |
| * The name of the icon font ligature. | |
| */ | |
| children: PropTypes.node, | |
| /** | |
| * Override or extend the styles applied to the component. | |
| * See [CSS API](#css) below for more details. | |
| */ | |
| classes: PropTypes.object.isRequired, |
This file contains hidden or 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
| /* | |
| Function to get matching pages by tags using a certain threshold (75) | |
| @param tags list of tags | |
| @param pages list of pages | |
| @returns list of related pages | |
| */ | |
| function related_pages(tags, pages) { | |
| // stores related pages | |
| const result = []; | |
This file contains hidden or 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": "redux", | |
| "version": "4.0.4", | |
| "description": "Predictable state container for JavaScript apps", | |
| "license": "MIT", | |
| "homepage": "http://redux.js.org", | |
| "repository": "github:reduxjs/redux", | |
| "bugs": "https://github.com/reduxjs/redux/issues", | |
| "authors": [ | |
| "Dan Abramov <dan.abramov@me.com> (https://github.com/gaearon)", |
This file contains hidden or 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
| // Iteration symbols | |
| Symbol.iterator | |
| Symbol.asyncIterator | |
| // RegEx symbols | |
| Symbol.match | |
| Symbol.matchAll | |
| Symbol.replace | |
| Symbol.search | |
| Symbol.split |
This file contains hidden or 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
| Symbol.prototype.for = (key) => { | |
| // Safely getting the global registry | |
| const symbolRegistry = window.symbolRegistry || {}; | |
| // Checking if this symbol exists | |
| if (symbolRegisty.hasOwnProperty(key)) { | |
| return symbolRegistry[key]; | |
| } | |
| // It does not, creating a new one |
This file contains hidden or 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
| const sym1 = Symbol.for('some-key'); // Symbol is created in global registry | |
| // Elsewhere in project: | |
| const sym2 = Symbol.for('some-key'); // Symbol is retrieved from global registry | |
| // They are the same symbol: | |
| console.log(sym1 === sym2); // true | |
| // You can even access the key property: | |
| console.log(Symbol.keyFor(sym1)); // some-key |