How to use the analytics-utils.paramsParse function in analytics-utils

To help you get started, we’ve selected a few analytics-utils 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 DavidWells / analytics / packages / analytics-core / src / index.js View on Github external
const nonAbortable = () => {
    // throw new Error(`${errorUrl}3`)
    throw new Error('Abort disabled in listener')
  }

  // Async promise resolver
  const resolvePromise = (resolver, cb) => {
    return (payload) => {
      if (cb) cb(payload)
      resolver(payload)
    }
  }

  // Parse URL parameters
  const params = paramsParse()
  // Initialize visitor information
  const initialUser = getPersistedUserData(params)

  /**
   * Analytic instance returned from initialization
   * @typedef {Object} AnalyticsInstance
   * @property {Identify} identify - Identify a user
   * @property {Track} track - Track an analytics event
   * @property {Page} page - Trigger page view
   * @property {User} user - Get user data
   * @property {Reset} reset - Clear information about user & reset analytics
   * @property {Ready} ready - Fire callback on analytics ready event
   * @property {On} on - Fire callback on analytics lifecycle events.
   * @property {Once} once - Fire callback on analytics lifecycle events once.
   * @property {GetState} getState - Get data about user, activity, or context.
   * @property {Storage} storage - storage methods
github netlify-labs / functions-site / src / pages / examples / index.js View on Github external
constructor (props, context) {
    super(props, context)
    const params = paramsParse()
    const search = (!params.search || params.search === true) ? '' : params.search

    this.state = {
      tag: search
    }
  }
  changeTag = (e) => {
github netlify-labs / functions-site / src / pages / admin / examples / index.js View on Github external
componentDidMount() {
    const params = paramsParse()
    if (params.url) {
      const url = (document.getElementsByName('url') || [{value: ''}])[0]
      url.value = params.url
    }
    if (params.title) {
      const title = (document.getElementsByName('name') || [{value: ''}])[0]
      title.value = decodeURI(params.title)
    }
  }
  handleSubmit = (e, data) => {
github netlify-labs / functions-site / src / pages / admin / tutorials / index.js View on Github external
componentDidMount() {
    const params = paramsParse()
    if (params.url) {
      const url = (document.getElementsByName('url') || [{value: ''}])[0]
      url.value = params.url
    }
    if (params.title) {
      const title = (document.getElementsByName('title') || [{value: ''}])[0]
      title.value = decodeURI(params.title)
    }
    const date = (document.getElementsByName('date') || [{value: ''}])[0]
    date.valueAsDate = new Date()
  }
  handleSubmit = (e, data) => {