How to use the reduxsauce.createTypes function in reduxsauce

To help you get started, we’ve selected a few reduxsauce 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 Kalcode / gatsby-boilerplate / src / reducers / forms / index.js View on Github external
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 = {}
github Kalcode / gatsby-boilerplate / src / reducers / prismic / index.js View on Github external
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,

reduxsauce

Some aesthetic toppings for your Redux meal.

MIT
Latest version published 12 months ago

Package Health Score

67 / 100
Full package analysis