New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flashbang

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flashbang

small set of awesome react utilities

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
2
Weekly downloads
 
Created
Source

flashbang

CircleCI Coverage Status

Install

npm install flashbang

Query State

Stores state in the url. Useful for search pages. Must be rendered inside react-router v4.

import { QueryState } from 'flashbang'

const example = ({ state, setState }) => (
  <div>
    <input
      value={state.test}
      onChange={e => setState({ test: e.target.value })}
    />
  </div>
);

export default QueryState(example);

Toggle

Toggle the display of data with three simple props!

import { Toggle } from 'flashbang'

<Toggle>
  <div toggle>Swap</div>

  <div on>This is shown when toggled</div>
  <div off>This is shown when not toggled</div>
</Toggle>

Paginate

Display 5 page numbers in either direction with next and previous buttons

Import the default css, or pass your own class names and use your own css!

import { Paginate } from 'flashbang';
import 'flashbang/dist/paginate/style.css';

export default () => (
  <Paginate
    page={5}
    pages={25}
    createURL={page => `?page=${page}`}
  />
);

Async Action

Changes text depending on promise status. Blocks onClick if a promise is in the middle of resolving, or finished.

import { AsyncAction } from 'flashbang'

<AsyncAction
  onClick={() => new Promise(resolve => setTimeout(resolve, 100))}
  before={<div>Create</div>}
  during={<div>Creating...</div>}
  after={<span>Created!</span>}
/>

Examples

The examples directory is a create-react-app module, so you can npm start or npm run build to see the demos live.

Keywords

FAQs

Package last updated on 11 Jan 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc