Socket
Book a DemoInstallSign in
Socket

pushkin-react

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pushkin-react

pushkin-react

1.1.0
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Pushkin React

Overview

Pushkin React is a system that uses React and Redux to simplify the process of creating client side, psychological quizzes.

Core Features

  • SurveyProvider a React component that connects to the redux store and internally handles fetching questions and sending responses
  • pushkinReducer a redux reducer that must be connected to the redux store

Spec

Pushkin React relies on a set of endpoints that match the pushkin-api spec. Pushkin React requires itself to be integrated into an existing redux store

Check out the demo app in this repo or run npm start to get going with pushkin-react

  • git clone --recursive
  • npm start

SurveyProvider

Props

nametypedescription
progressfunctionAn option function that is called whenever a user answers a question
instructionsStringA line of text you want displayed before the user begins the survey
resultsContainerfunctiona function that takes the results returned from the api, and returns a react component

Get started

Import pushkinReducer and bring it into your redux store (make sure you have redux-thunk configured)


    import { combineReducers } from 'redux';
    import pushkinReducer from 'pushkin-react';
    
    export const rootReducer = combineReducers({
      pushkin: pushkinReducer
    });

Import SurveyProvider and render it on the page

    render() {
      return (
            <SurveyProvider 
              progress={this.dispatchProgress}
              instructions={Scripts.instruction}
              resultsContainer={(results) => (
                <ResultsContainer results={results} />
              )}
            />
      );
    }

Extension

Keywords

react-component

FAQs

Package last updated on 22 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.