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

branch-picker

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

branch-picker

A lightweight library for managing hierarchical data with synchronization.

unpublished
latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

BranchPicker Library

BranchPicker is a zero dependency lightweight library designed for TypeScript projects, and it offers the following features:

  • Simplifies the management of hierarchical data, like trees, with unique synchronization capabilities:

    • Effortlessly pick parent and children nodes.
    • Automatically synchronize parent selections when all children are cleared.
  • Framework-agnostic: Use it seamlessly in any TypeScript project, regardless of the framework.

  • Headless: Provides complete control and flexibility for UI integration.

Table of Contents

  • Installation
  • Usage
  • Interface
  • TypeScript Support
  • Contributing
  • License

Installation

To use the BranchPicker library in your project, you can install it via npm or yarn.

npm install branch-picker

or

yarn add branch-picker

Usage

The BranchPicker library is headless, meaning it doesn't come with a specific UI or framework tie-ins. It's designed to be framework-agnostic and can be used in various environments, including TypeScript-based projects.

Here's a basic example of how to use it:

import { useBranchPicker } from 'branch-picker';

// Define your data and options
const data = // Your hierarchical data

// Create a BranchPicker instance using the adapter
const { branchPicker } = useBranchPicker({
  data,
  state: {},
  getSubBranches: (item) => // Your function to get sub-branches,
  getBranchId: (item) => // Your function to get a branch's ID,
  onStateChange: (state) => // Handle state changes,
});

// Use the BranchPicker instance to manage and interact with your data
// ...

Working example

https://codesandbox.io/s/long-monad-9fchys

TypeScript Support

The BranchPicker library fully supports TypeScript, providing type definitions for its core components. You can take full advantage of TypeScript's static type checking and code intelligence when using this library.

Contributing

If you'd like to contribute to the BranchPicker library, please check the CONTRIBUTING.md file for guidelines on how to get started. (coming soon)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

tree

FAQs

Package last updated on 31 Oct 2023

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