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

collider-particle

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collider-particle

Fetch handler for react-collider

  • 0.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Collider-Particle Build Status

Fetch handler for React-Collider (can be used outside).

Collider-Particle gather all the calls your components need from an API and join then to make the smallest number of call possible. For example if a module needs to call /video/1?fields=title and another one needs /video/1?fields=created_time, collider-particle will call /video/1?fields=title,created_time.

Installation

$ npm install --save collider-particle

Usage

If you use collider-particle with react-collider:

import particle from 'collider-particle'
import {server as collider} from 'react-collider'
import routes from './routing'

collider(routes, particle({baseUrl: 'https://api.dailymotion.com'}))
import provider from 'provider'

class VideoItem extends React.Component {
    static fields() {
        return ['title', 'thumbnail_240_url']
    }
    static endpoint() {
        return '/video'
    }
    render() {
        return (
            <div>{this.props.title}<div>
        )
    }
}

export default class VideoList extends React.Component {
    static getDependencies() {
        return [VideoItem]
    }
    static endpoint() {
        return '/videos'
    }
    static fields() {
        return ['title', 'owner.usernname']
    }
    static fetchData() {
        return provider(this)
    }
    render() {
        var videos = this.props.data.list.map(function(video) {
            return <VideoItem />
        })

        return (
            <div>{videos}</div>
        )
    }
}

Keywords

FAQs

Package last updated on 27 Apr 2015

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