@helpusersvote/election-logic

0.2.2 • Public • Published

@helpusersvote/election-logic

JavaScript functions to check if a call-to-action should be rendered

Installation

First, add the module to your codebase:

npm install --save @helpusersvote/election-logic

Usage

In your app, import functions from the @helpusersvote/election-logic module:

import { shouldShowCTA } from '@helpusersvote/election-logic'

// Optional `regions` configuration, defaults to USA
const regions = [
  'city:San Francisco',
  'state:California',
  'country:USA'
]

// wherever you want to render the call-to-action
if (shouldShowCTA({ regions })) {
  // render a custom banner or use `@helpuservote/election-copy`
}

License

All modules are open-sourced under the MIT License

/@helpusersvote/election-logic/

    Package Sidebar

    Install

    npm i @helpusersvote/election-logic

    Weekly Downloads

    5

    Version

    0.2.2

    License

    MIT

    Unpacked Size

    79.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • fouad