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

forgo-state

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forgo-state - npm Package Compare versions

Comparing version 1.0.17 to 1.0.18

22

dist/index.js

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bindToStateProps = exports.bindToStates = exports.defineState = void 0;
const forgo_1 = require("forgo");
import { rerender, getForgoState, } from "forgo";
const stateMap = new Map();
function defineState(state) {
export function defineState(state) {
const handlers = {

@@ -42,3 +39,3 @@ set(target, prop, value) {

const componentStatesAndArgs = argsToUpdatePlusPendingArgs.map((x) => {
const state = forgo_1.getForgoState(x.element.node);
const state = getForgoState(x.element.node);
if (!state) {

@@ -56,3 +53,3 @@ throw new Error("Missing state on node.");

let node = args.element.node;
let state = forgo_1.getForgoState(node);
let state = getForgoState(node);
let parentStates = state.components.slice(0, args.element.componentIndex);

@@ -65,3 +62,3 @@ while (node && state) {

if (node) {
state = forgo_1.getForgoState(node);
state = getForgoState(node);
if (state) {

@@ -87,3 +84,2 @@ parentStates = state.components.filter((x) => x !== componentState);

}
exports.defineState = defineState;
let argsToRenderInTheNextCycle = [];

@@ -94,3 +90,3 @@ function doRender() {

if (args.element.node) {
forgo_1.rerender(args.element);
rerender(args.element);
}

@@ -101,7 +97,6 @@ }

}
function bindToStates(states, component) {
export function bindToStates(states, component) {
return bindToStateProps(states.map((state) => [state, undefined]), component);
}
exports.bindToStates = bindToStates;
function bindToStateProps(stateBindings, component) {
export function bindToStateProps(stateBindings, component) {
const wrappedComponent = Object.assign(Object.assign({}, component), { mount(props, args) {

@@ -150,3 +145,2 @@ for (const [state, propGetter] of stateBindings) {

}
exports.bindToStateProps = bindToStateProps;
//# sourceMappingURL=index.js.map
{
"name": "forgo-state",
"version": "1.0.17",
"version": "1.0.18",
"main": "./dist",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

@@ -6,3 +6,3 @@ {

"target": "ES2015",
"module": "CommonJS",
"module": "ESNext",
"moduleResolution": "Node",

@@ -9,0 +9,0 @@ "declaration": true,

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