tree-changes-hook
React hook for tree-changes
Last updated 5 years ago by gilbarbara .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tree-changes-hook 
SYNC missed versions from official npm registry.

tree-changes-hook

NPM version build status Quality Gate Status Coverage

React hook that uses tree-changes to compare changes between two datasets.

Setup

npm install tree-changes-hook

Usage

import React from 'react';
import useTreeChanges from 'tree-changes-hook';

function App(props) {
  const { changed } = useTreeChanges(props);

  React.useEffect(() => {
    if (changed('hasData', true)) {
    	sendAnalyticsEvent('load', 'MySuperPage');
  	}
  });

  return <div>...</div>;
}

It's safe to run all the methods with a useEffect without dependencies, but it works with them too.

API

Please refer to tree-changes README for detailed usage.

License

MIT

Current Tags

  • 0.11.3                                ...           latest (a year ago)
  • 0.11.0-alpha.1                                ...           next (2 years ago)

15 Versions

  • 0.11.3                                ...           a year ago
  • 0.11.2                                ...           2 years ago
  • 0.11.1                                ...           2 years ago
  • 0.11.0                                ...           2 years ago
  • 0.11.0-alpha.1                                ...           2 years ago
  • 0.11.0-alpha.0                                ...           2 years ago
  • 0.10.0                                ...           4 years ago
  • 0.9.3                                ...           4 years ago
  • 0.9.2                                ...           4 years ago
  • 0.9.1                                ...           4 years ago
  • 0.9.0                                ...           4 years ago
  • 0.8.0                                ...           5 years ago
  • 0.7.1                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 2
Last Month 7
Dependencies (8)
Dev Dependencies (2)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |