Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { createReducer, createTypes } from 'reduxsauce'
import analytics from 'analytics'
export const Types = createTypes(`
HONEYPOTTED
INIT
REGISTER
SET
SUBMIT
SUBMITTED
`, { prefix: '@@app/forms/' })
export const register = (id) => ({ type: Types.REGISTER, id })
export const submit = (formId, data) => ({ type: Types.SUBMIT, formId, data })
export const submitted = (formId, data) => ({ type: Types.SUBMITTED, formId, data })
export const set = (formId, id, value) => ({ type: Types.SET, formId, id, value })
export const honeypotted = (formId) => ({ type: Types.HONEYPOTTED, formId })
const INITIAL_STATE = {}
import { createReducer, createTypes } from 'reduxsauce'
export const Types = createTypes(`
INIT
FETCH
FETCHREF
FETCHEDREF
FETCHED
`, { prefix: '@@app/prismic/' })
export const fetch = (page) => ({ type: Types.FETCH, page })
export const fetchRef = (ref) => ({ type: Types.FETCHREF, ref })
export const fetchedRef = (ref, error) => ({ type: Types.FETCHEDREF, ref, error })
export const fetched = (data, error) => ({ type: Types.FETCHED, data, error })
const INITIAL_STATE = {
data: null,
error: null,
fetching: false,