
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
react-tracker-connect
Advanced tools
react component decorator to connect reactive data with meteor tracker
Performant way to connect reactive data from meteor with react components (see #13)
$ npm install --save react-tracker-connect
import React, { Component } from 'react'
import connect from 'react-tracker-connect'
import { ReactiveVar } from 'meteor/reactive-var'
const reactiveVar = new ReactiveVar()
// with component classes
@connect((props) => ({
reactive: reactiveVar.get(),
}))
export default class Foo extends Component {
constructor() {
super()
this.state = {}
// …
}
render() {
const { reactive } = this.props
return (
// …
)
}
}
// with stateless components
function Stateless({ reactive }) {
return (
// …
)
}
export default connect((props) => ({
reactive: reactiveVar.get(),
}))(Stateless)
The connect
decorator takes 2 arguments. The first argument is a function which gets called with the current props object as the first parameter. This function runs reactive, the return value will be merged with the current props and passed to your component.
You can pass options
via the second argument and the following signature:
{
// Optional. A function of two arguments, called on the old value and the new value whenever a prop was updated.
compare: (a, b) => a === b,
// Optional. An array with the props which will be passed to the reactive function.
// This option can be used to finetune, which props should be checked if they've changed.
allowedProps: ['reactive'],
// Optional, Base component which will be extended.
// Defaults to PureComponent
BaseComponent: React.Component,
}
Licensed under MIT license. Copyright (c) 2017 Max Nowack
Contributions are welcome. Please open issues and/or file Pull Requests.
FAQs
react component decorator to connect reactive data with meteor tracker
We found that react-tracker-connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.