New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iteam/bs-hooks

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iteam/bs-hooks

A collection of reusable hooks for ReasonML

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Iteam Hooks for ReasonML

This is port of @iteam/hooks for ReasonML/BuckleScript. Still a work in progress.

Installation

npm install @iteam/bs-hooks

Add @iteam/bs-hooks to bs-dependencies in bsconfig.json

Available Hooks

useToggle

useToggle(~initialState: option(bool), unit): (bool, unit => unit)
Example
[@react.component]
let make = () => {
  let (isAlive, toggleValue) = IteamHooks.useToggle();

  <button onClick={_ => toggleValue()}>
    {
      isAlive ? {j|🚀|j} : {j|😴|j};
    }
    ->React.string
  </button>;
};

useQueryParam

Gets a value from a specified query param

useQueryParam(~param: Js.Dict.key): string
Example
[@react.component]
let make = () => {
  let param = IteamHooks.useQueryParam(~param="sweetParam");

  <div>
    {"That's a nice query param with the value " ++ param |> React.string}
  </div>;
};

Keywords

FAQs

Package last updated on 18 Apr 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

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