source: imaps-frontend/node_modules/react-use/lib/useToggle.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 360 bytes
RevLine 
[d565449]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var react_1 = require("react");
4var toggleReducer = function (state, nextValue) {
5 return typeof nextValue === 'boolean' ? nextValue : !state;
6};
7var useToggle = function (initialValue) {
8 return react_1.useReducer(toggleReducer, initialValue);
9};
10exports.default = useToggle;
Note: See TracBrowser for help on using the repository browser.