Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-interval-formatter

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-interval-formatter

Update a value in realtime

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
7
Weekly downloads
 
Created
Source

react-interval-formatter

A React formatter that updates the element each 15 seconds

Demo

Install

yarn install react-interval-formatter

or

npm install react-interval-formatter --save

Properties

tag : string

The tag you want to rendered

formatter : function

A function that knows how to format the value prop

value : string

The value that is going to be passed to the formatter

othersProps

You can send any props you want, i.e.: onClick, className, etc...

Example

import IntervalFormatter from 'react-interval-formatter'

let multiplier = 1
const formatter = (value) =>
  `${value} * ${multiplier} = ${value * multiplier++}`

export default () => 
  <IntervalFormatter
    tag='label'
    formatter={formatter}
    value={10}
    className='ten-multiplier'
    onClick={() => alert('aaa')}
  />;

It will render
Instantly: <label class="ten-multiplier">10 * 1 = 10</div>
15 seconds later: <label class="ten-multiplier">10 * 2 = 20</div>
30 seconds later: <label class="ten-multiplier">10 * 3 = 30</div>

FAQs

Package last updated on 17 Aug 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

  • 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