Socket
Socket
Sign inDemoInstall

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.0 to 0.5.1

31

build/index.d.ts

@@ -24,2 +24,5 @@ import { FC } from 'react';

} & [() => K];
declare type Reactionable<T> = {
0: () => T;
} | [() => T] | (() => T);
declare function value<T = void>(): Value<T>;

@@ -30,11 +33,5 @@ declare function value<T = void>(init: T): Value<T>;

declare function signal<T = void>(init: T): Signal<T>;
declare function on<T>(target: {
0: () => Ensurable<T>;
} | [() => Ensurable<T>] | (() => Ensurable<T>), listener: (value: T, prev?: T) => void): () => void;
declare function on<T>(target: {
0: () => T;
} | [() => T] | (() => T), listener: (value: T, prev?: T) => void): () => void;
declare function sync<T>(target: {
0: () => T;
} | [() => T] | (() => T), listener: (value: T, prev?: T) => void): () => void;
declare function on<T>(target: Reactionable<Ensurable<T>>, listener: (value: T, prev?: T) => void): () => void;
declare function on<T>(target: Reactionable<T>, listener: (value: T, prev?: T) => void): () => void;
declare function sync<T>(target: Reactionable<T>, listener: (value: T, prev?: T) => void): () => void;
declare function effect(fn: () => void): void;

@@ -54,17 +51,7 @@ declare function effect(fn: () => () => any): () => any;

declare function observe<T extends FC>(FunctionComponent: T): T;
declare function useLocal<T extends unknown[], M>(target: (new (...args: T) => M | (() => M) | {
0: () => M;
} | [() => M]) | ((...args: T) => M | (() => M) | {
0: () => M;
} | [() => M]), deps?: T): M;
declare function useValue<T>(target: (() => T) | {
0: () => T;
} | [() => T], deps?: any[]): T;
declare function useShared<M>(target: (new (init?: any) => M | (() => M) | {
0: () => M;
} | [() => M]) | ((init?: any) => M | (() => M) | {
0: () => M;
} | [() => M])): M;
declare function useLocal<T extends unknown[], M>(target: (new (...args: T) => M | Reactionable<M>) | ((...args: T) => M | Reactionable<M>), deps?: T): M;
declare function useValue<T>(target: Reactionable<T>, deps?: any[]): T;
declare function useShared<M>(target: (new (init?: any) => M | Reactionable<M>) | ((init?: any) => M | Reactionable<M>)): M;
declare function free(): void;
declare function prop(_proto: any, key: any, descriptor?: any): any;
declare function cache(_proto: any, key: any, descriptor: any): any;
{
"name": "realar",
"version": "0.5.0",
"version": "0.5.1",
"description": "React state manager",

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

},
"gitHead": "088be83e6d61badc4cd0b82832a4567cb37564bd"
"gitHead": "2e9dddbad076f15f7cb3b0f65a1444d6381a77aa"
}

@@ -233,5 +233,5 @@ # Realar

const App = () => {
const count = useValue(count);
const value = useValue(count);
return (
<p>{count}</p>
<p>{value}</p>
)

@@ -238,0 +238,0 @@ }

@@ -97,2 +97,4 @@ import React, { Context, FC } from 'react';

type Reactionable<T> = { 0: () => T } | [() => T] | (() => T);
function value<T = void>(): Value<T>;

@@ -156,7 +158,7 @@ function value<T = void>(init: T): Value<T>;

function on<T>(
target: { 0: () => Ensurable<T> } | [() => Ensurable<T>] | (() => Ensurable<T>),
target: Reactionable<Ensurable<T>>,
listener: (value: T, prev?: T) => void
): () => void;
function on<T>(
target: { 0: () => T } | [() => T] | (() => T),
target: Reactionable<T>,
listener: (value: T, prev?: T) => void

@@ -194,3 +196,3 @@ ): () => void;

function sync<T>(
target: { 0: () => T } | [() => T] | (() => T),
target: Reactionable<T>,
listener: (value: T, prev?: T) => void

@@ -275,4 +277,4 @@ ): () => void {

target:
| (new (init?: any) => M | (() => M) | { 0: () => M } | [() => M])
| ((init?: any) => M | (() => M) | { 0: () => M } | [() => M])
| (new (init?: any) => M | Reactionable<M>)
| ((init?: any) => M | Reactionable<M>)
): M => {

@@ -326,4 +328,4 @@ const context_data = useContext(get_scope_context());

target:
| (new (...args: T) => M | (() => M) | { 0: () => M } | [() => M])
| ((...args: T) => M | (() => M) | { 0: () => M } | [() => M]),
| (new (...args: T) => M | Reactionable<M>)
| ((...args: T) => M | Reactionable<M>),
deps = [] as T

@@ -340,3 +342,3 @@ ): M {

function useValue<T>(target: (() => T) | { 0: () => T } | [() => T], deps: any[] = []): T {
function useValue<T>(target: Reactionable<T>, deps: any[] = []): T {
const forceUpdate = is_observe || useForceUpdate();

@@ -369,4 +371,4 @@ const h = useMemo(() => {

target:
| (new (init?: any) => M | (() => M) | { 0: () => M } | [() => M])
| ((init?: any) => M | (() => M) | { 0: () => M } | [() => M])
| (new (init?: any) => M | Reactionable<M>)
| ((init?: any) => M | Reactionable<M>)
): M {

@@ -373,0 +375,0 @@ return useValue(shared(target as any));

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