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

react-ajaxing

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ajaxing - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

24

dist/index.js

@@ -10,17 +10,31 @@ // Generated by CoffeeScript 1.9.3

displayName: "ajaxing",
getDefaultProps: function() {},
getDefaultProps: function() {
return {
size: '20'
};
},
render: function() {
var classes;
classes = 'ajax-double-bounce';
var classes, style;
classes = 'react-ajaxing';
if (this.props.className) {
classes = classes + " " + this.props.className;
}
if (this.props.size) {
style = {
width: this.props.size + "px",
height: this.props.size + "px"
};
}
if (this.props.loading) {
return React.createElement("div", React.__spread({}, this.props, {
"className": classes
"className": classes,
"style": style
}), React.createElement("div", {
"className": "ajax-double-bounce",
"style": style
}, React.createElement("div", {
"className": "ajax-double-bounce1"
}), React.createElement("div", {
"className": "ajax-double-bounce2"
}));
})));
} else {

@@ -27,0 +41,0 @@ return this.props.children;

{
"name": "react-ajaxing",
"description": "tell the component ajax is sending",
"version": "0.0.3",
"version": "0.0.4",
"author": "Bingo Yang <blackbing@gmail.com>",

@@ -6,0 +6,0 @@ "browserify": {

# react-ajaxing
tell the component ajax is sending
[![react-ajaxing](http://i.imgur.com/A3PPhCY.gif)](http://i.imgur.com/A3PPhCY.gif)
# Usage
```jsx
var Spinner = require('react-ajaxing');
//...
login: function(){
this.setState({
loading: true
});
this.setTimeout( ()=>{
this.setState({
loading: false
});
}, 1500);
},
render: function(){
return (
<button type ="submit" onClick={@login}>
<Spinner loading={@state.loading} size={20}><span>Login</span></Spinner>
</button>
)
}
```
# Options
### size(number): spinner size(px)
default: 20
### loading(boolean): indicate it is loading status or not

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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