How to use gud - 2 common examples

To help you get started, we’ve selected a few gud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamiebuilds / create-react-context / src / implementation.js View on Github external
function createReactContext(
  defaultValue: T,
  calculateChangedBits: ?(a: T, b: T) => number
): Context {
  const contextProp = '__create-react-context-' + gud() + '__';

  class Provider extends Component> {
    emitter = createEventEmitter(this.props.value);

    static childContextTypes = {
      [contextProp]: PropTypes.object.isRequired
    };

    getChildContext() {
      return {
        [contextProp]: this.emitter
      };
    }

    componentWillReceiveProps(nextProps) {
      if (this.props.value !== nextProps.value) {

gud

Create a 'gud nuff' (not cryptographically secure) globally unique id

MIT
Latest version published 6 years ago

Package Health Score

65 / 100
Full package analysis

Popular gud functions