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

realar

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

realar - npm Package Compare versions

Comparing version 0.5.11 to 0.5.12

1

build/index.d.ts

@@ -40,2 +40,3 @@ import { FC } from 'react';

declare function ready<T = void>(init: T): Signal<T>;
declare function ready<T>(init: T, to: T): Signal<void>;
declare function wrap<T, K, P>(target: Signal<T, K>, set: () => T, get: (data: K) => P): Signal<void, P>;

@@ -42,0 +43,0 @@ declare function wrap<T, K, P, M = T>(target: Signal<T, K>, set: (data: M) => T, get: (data: K) => P): Signal<M, P>;

12

build/index.js

@@ -80,8 +80,14 @@ "use strict";

exports.signal = signal;
function ready(init) {
function ready(init, to) {
let resolved = false;
let resolve;
const [get, set] = reactive_box_1.box([init]);
const fn = function (data) {
set([data]);
resolve(data);
if (!resolved) {
resolved = true;
if (to)
data = to;
set([data]);
resolve(data);
}
};

@@ -88,0 +94,0 @@ def_format(fn, () => get()[0], fn, 1);

{
"name": "realar",
"version": "0.5.11",
"version": "0.5.12",
"description": "React state manager",

@@ -88,3 +88,3 @@ "repository": {

},
"gitHead": "c6d8c311f3fbe5a70fff4711cc5df471d624b53b"
"gitHead": "315b346dcdb3868e0de928713d2a78781174002e"
}

@@ -430,3 +430,3 @@ # Realar

_Documentation not ready yet for `effect`, `loop`, `pool`, `stoppable`, `initial`, `mock`, `unmock`, `free`, `transaction`, `untrack`, `isolate`, `wrap`, `ready` functions. It's coming soon._
_Documentation not ready yet for `effect`, `loop`, `pool`, `stoppable`, `initial`, `mock`, `unmock`, `free`, `transaction`, `untrack`, `isolate`, `wrap`, `ready`, `once` functions. It's coming soon._

@@ -433,0 +433,0 @@ ### Demos

@@ -151,3 +151,5 @@ import React, { Context, FC } from 'react';

function ready<T = void>(init: T): Signal<T>;
function ready(init?: any) {
function ready<T>(init: T, to: T): Signal<void>;
function ready(init?: any, to?: any) {
let resolved = false;
let resolve: any;

@@ -157,4 +159,8 @@ const [get, set] = box([init]);

const fn = function (data: any) {
set([data]);
resolve(data);
if (!resolved) {
resolved = true;
if (to) data = to;
set([data]);
resolve(data);
}
};

@@ -161,0 +167,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