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

@equinor/fusion

Package Overview
Dependencies
Maintainers
2
Versions
485
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion - npm Package Compare versions

Comparing version 0.1.25 to 0.1.26

6

lib/core/ContextManager.d.ts

@@ -7,2 +7,5 @@ import ApiClients from "../http/apiClients";

history: Context[] | null;
links: {
[key: string]: string;
};
};

@@ -14,2 +17,5 @@ export default class ContextManager extends ReliableDictionary<ContextCache> {

setCurrentContextAsync(context: Context): Promise<void>;
private updateHistoryAsync;
private updateLinksAsync;
getLinkedContext(context: Context): Promise<Context | null>;
getCurrentContext(): Context | null;

@@ -16,0 +22,0 @@ getHistory(): Context[];

24

lib/core/ContextManager.js

@@ -17,3 +17,2 @@ import { useState, useCallback, useEffect } from "react";

const currentContext = await this.getCurrentContextAsync();
const history = await this.getAsync("history");
await this.setAsync("current", context);

@@ -23,3 +22,8 @@ if (!currentContext) {

}
this.updateHistoryAsync(currentContext);
this.updateLinksAsync(currentContext, context);
}
async updateHistoryAsync(currentContext) {
const newHistory = [currentContext];
const history = await this.getAsync("history");
if (history) {

@@ -35,2 +39,20 @@ history

}
async updateLinksAsync(currentContext, newContext) {
const links = await this.getAsync("links");
await this.setAsync("links", Object.assign({}, (links || {}), { [currentContext.id]: newContext.id }));
}
async getLinkedContext(context) {
const links = await this.getAsync("links");
if (!links || !links[context.id]) {
return null;
}
const linkedContextId = links[context.id];
const history = await this.getAsync("history");
const contextFromHistory = history ? history.find(c => c.id === linkedContextId) : null;
if (contextFromHistory) {
return contextFromHistory;
}
const response = await this.contextClient.getContextAsync(linkedContextId);
return response.data || null;
}
getCurrentContext() {

@@ -37,0 +59,0 @@ // Avoid returning cached context if we're in the process of resolving a context from the current route

2

package.json
{
"name": "@equinor/fusion",
"version": "0.1.25",
"version": "0.1.26",
"description": "Everything a Fusion app needs to communicate with the core",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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