New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

use-assignment-state

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-assignment-state

React hook that give you the ability to have an state object that can perform changes with an assignment call.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

useAssignmentState · NPM

React hook that give you the ability to have an state object that can perform changes with an assignment call.

I made this hook inspired in the new svelte 3.0 syntax, wich you can look here.

This was created for fun and, to be honest, I don`t really know if you should be using it, but that's your choice.

Install

npm install --save use-assignment-state

or

yarn add use-assignment-state

Usage

import React from 'react'
import useAssignmentState from 'use-assignment-state'

const Example = () => {
  const state = useAssignmentState({
    key: 'val',
  });

  return (
    <input
      value={state.key}
      onChange={(e) => { state.key = e.target.value; }}
    />
  );
};

More examples

You can check more examples here.

License

MIT © tcK1

FAQs

Package last updated on 28 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts