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

react-use-sub

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-sub - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

CHANGELOG.md

3

dist/cjs/index.js

@@ -41,4 +41,3 @@ 'use strict';

const p = D.data[key];
const n = next[key];
result[key] = n !== undefined ? n : p;
result[key] = key in next ? next[key] : p;
});

@@ -45,0 +44,0 @@ D.data = result;

@@ -37,4 +37,3 @@ import { useRef, useCallback, useEffect, useState } from 'react';

const p = D.data[key];
const n = next[key];
result[key] = n !== undefined ? n : p;
result[key] = key in next ? next[key] : p;
});

@@ -41,0 +40,0 @@ D.data = result;

{
"name": "react-use-sub",
"version": "1.2.0",
"version": "2.0.0",
"description": "Subscription based lightweight React store",

@@ -5,0 +5,0 @@ "type": "module",

@@ -56,11 +56,6 @@ [![GitHub license][license-image]][license-url]

### Optional types
Since TypeScript [can not distinguish](https://github.com/microsoft/TypeScript/issues/13195)
between missing fields and undefined values, you have to use `null`
on top-level. Please don't use optional fields on top-level. Updates
with `undefined` on top-level will be simply ignored.
Since version [2.0.0](https://github.com/fdc-viktor-luft/react-use-sub/blob/master/CHANGELOG.md#200---2021-03-21) you
can simply specify the optional type you want.
```ts
// BAD
type State = { lastVisit?: Date };
// GOOD
type State = { lastVisit: null | Date };

@@ -67,0 +62,0 @@ ```

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