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

@equinor/fusion-observable

Package Overview
Dependencies
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion-observable - npm Package Compare versions

Comparing version 8.1.4 to 8.1.5

2

dist/esm/create-action.js

@@ -18,3 +18,3 @@ export function createAction(type, prepareAction) {

export const actionSuffixDivider = '::';
export const matchActionSuffix = (suffix) => new RegExp(`${actionSuffixDivider}\\${suffix}$`);
export const matchActionSuffix = (suffix) => new RegExp(`${actionSuffixDivider}${suffix}$`);
export const actionBaseType = (action) => action.type.replace(matchActionSuffix('\\w+$'), '');

@@ -21,0 +21,0 @@ export function getType(actionCreator) {

@@ -1,14 +0,20 @@

import { useLayoutEffect, useMemo, useState } from 'react';
import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { useObservableLayoutSubscription } from './useObservableSubscription';
export function useObservableState(subject, opt) {
const [next, setNext] = useState(() => {
return (opt === null || opt === void 0 ? void 0 : opt.initial) ? ('value' in subject ? subject.value : opt.initial) : undefined;
});
const resolveInitial = useCallback(() => {
var _a, _b;
return (_b = (_a = opt === null || opt === void 0 ? void 0 : opt.initial) !== null && _a !== void 0 ? _a : subject.value) !== null && _b !== void 0 ? _b : undefined;
}, [subject, opt === null || opt === void 0 ? void 0 : opt.initial]);
const initialValue = useRef(resolveInitial());
const [next, setNext] = useState(initialValue.current);
const [error, setError] = useState(null);
const [complete, setComplete] = useState(false);
useLayoutEffect(() => {
initialValue.current = resolveInitial();
}, [resolveInitial]);
useLayoutEffect(() => {
setError(null);
setComplete(false);
setNext('value' in subject ? subject.value : undefined);
}, [setNext, setError, setComplete, subject]);
setNext(initialValue.current);
}, [setNext, setError, setComplete, subject, initialValue]);
const subscriber = useMemo(() => ({

@@ -15,0 +21,0 @@ next: setNext,

@@ -1,2 +0,2 @@

export const version = '8.1.4';
export const version = '8.1.5';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,1 @@

export declare const version = "8.1.4";
export declare const version = "8.1.5";
{
"name": "@equinor/fusion-observable",
"version": "8.1.4",
"version": "8.1.5",
"description": "WIP",

@@ -66,3 +66,3 @@ "keywords": [

"@types/uuid": "^9.0.4",
"happy-dom": "^12.0.1",
"happy-dom": "^13.3.8",
"react": "^18.2.0",

@@ -69,0 +69,0 @@ "typescript": "^5.1.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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