Socket
Book a DemoInstallSign in
Socket

@theuybv/use-todos

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

@theuybv/use-todos

Made with create-react-library

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

Simplifying the React Redux Example Todo List App with custom use-todos hooks

Example Redux Todo App: https://redux.js.org/basics/example

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save @theuybv/use-todos

Redux Store Provider on App level

import React from "react";
import { render } from "react-dom";
import App from "./components/App";

import {TodosProvider} from "@theuybv/use-todos";

const Index = () => {

  return (
    <TodosProvider>
      {" "}
      <App />
    </TodosProvider>
  );
};

render(<Index />, document.getElementById("root"));

Actions, Selectors and Constants

import React from 'react';
import useTodos from "@theuybv/use-todos";
const SomeComp = () => {
  const {actions, selectors, VISIBILITY_FILTERS} = useTodos();
  const {toggleTodo, addTodo, setVisibility} = actions; // similar to stateToProps
  const {todos, active} = selectors; // similar to dispatchToProps
  const {SHOW_ALL, SHOW_COMPLETED, SHOW_ACTIVE} = VISIBILITY_FILTERS;


  return (
    <div>Do something with it!</div>
  )
}

License

MIT © theuybv

FAQs

Package last updated on 15 Jul 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.