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

deep-storage

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-storage - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

4

lib/async.d.ts

@@ -22,2 +22,3 @@ import { DeepStorage, UsesDeepStorage } from "./index";

rerun(): Promise<DeepAsyncData<Request, Response>>;
update(response: Response): Promise<DeepAsyncData<Request, Response>>;
}

@@ -31,3 +32,4 @@ export declare class AlreadyRunningError extends Error {

run: (request: Request) => Promise<DeepAsyncData<Request, Response>>;
rerun(): Promise<DeepAsyncData<Request, Response>>;
rerun: () => Promise<DeepAsyncData<Request, Response>>;
update: (response: Response) => Promise<DeepAsyncData<Request, Response>>;
readonly status: AsyncStatus;

@@ -34,0 +36,0 @@ readonly running: boolean;

@@ -107,6 +107,16 @@ "use strict";

}); };
this.rerun = function () {
return _this.run(_this.request);
};
this.update = function (response) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.storage.update(function (state) { return (__assign({}, state, { status: AsyncStatus.Succeeded, response: response, error: undefined })); })];
case 1:
_a.sent();
return [2 /*return*/, this.storage.state];
}
});
}); };
}
DefaultDeepAsync.prototype.rerun = function () {
return this.run(this.request);
};
Object.defineProperty(DefaultDeepAsync.prototype, "status", {

@@ -113,0 +123,0 @@ get: function () { return this.storage.state.status; },

{
"name": "deep-storage",
"version": "0.3.3",
"version": "0.3.4",
"description": "Simple observable state management for reactive applications",

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

@@ -27,2 +27,3 @@ import { DeepStorage, UsesDeepStorage } from "./index";

rerun(): Promise<DeepAsyncData<Request, Response>>;
update(response: Response): Promise<DeepAsyncData<Request, Response>>;
}

@@ -52,5 +53,9 @@

}
rerun(): Promise<DeepAsyncData<Request, Response>> {
rerun = (): Promise<DeepAsyncData<Request, Response>> => {
return this.run(this.request);
}
update = async (response: Response): Promise<DeepAsyncData<Request, Response>> => {
await this.storage.update(state => ({ ...state, status: AsyncStatus.Succeeded, response, error: undefined }));
return this.storage.state;
}
get status() { return this.storage.state.status; }

@@ -57,0 +62,0 @@ get running() { return this.storage.state.status === AsyncStatus.Running }

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