🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-derive

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-derive - npm Package Compare versions

Comparing version

to
0.0.2

2

package.json
{
"name": "react-derive",
"version": "0.0.1",
"version": "0.0.2",
"description": "Derived data for your memoizing pleasure",

@@ -5,0 +5,0 @@ "main": "lib",

@@ -15,3 +15,3 @@ # react-derive

We can move the calculation of `a+b` to a decorator named `@derive`
where we'll create the *deriver* function named sum `sum`. And because we
where we'll create the *deriver* function named `sum`. And because we
named the function `sum`, the deriver's result will be passed

@@ -30,2 +30,4 @@ into the `Add` component via a prop likewise named `sum`.

Note that the first and only argument to a *deriver* function is always `newProps`.
But wait, every time the component renders, `sum` will recalculate even

@@ -92,1 +94,5 @@ if `a` and `b` didn't change. To optimize, we can memoize the calculation with `@track`

import {derive, track} from 'react-derive';
or when included via script tag it's available as the global variable `ReactDerive`:
const {derive, track} = ReactDerive;