Socket
Socket
Sign inDemoInstall

@iteam/bs-hooks

Package Overview
Dependencies
12
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @iteam/bs-hooks

A collection of reusable hooks for ReasonML


Version published
Maintainers
5
Created

Changelog

Source

0.1.5 (2020-11-18)

Bug Fixes

  • updated dependencies (ff457b7)

Readme

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

Last updated on 18 Apr 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc