GithubHelp home page GithubHelp logo

ptzagk / flash-cards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jordanwinslow/flash-cards

0.0 0.0 0.0 422 KB

Create, Edit & View Flippable Flash Cards. Designed With React, Redux Toolkit, React Router & MaterialUI

Home Page: https://redux-flash-cards.netlify.com/

License: Other

HTML 4.66% CSS 2.02% TypeScript 93.31%

flash-cards's Introduction

Flash Cards

Netlify Status

Create

Create new flashcards by clicking the + icon in the bottom nav, filling out the front and back of the card & clicking the check mark. Validation & error feedback is not yet implemented.

Read

View flashcards by clicking the back and forward arrows in the bottom nav. See the back of a Flash Card by clicking anywhere on the card.

Update

Update is not yet implemented.

Delete

Delete any flash card by clicking the trash icon.

License: Attribution-NonCommercial-ShareAlike 4.0 International https://creativecommons.org/licenses/by-nc-sa/4.0/

Making Redux Easy With Toolkit

Redux Toolkit is the official, opinionated, batteries-included toolset for efficient Redux development and is intended to be the standard way to write Redux logic.

What Are The Core Benefits Of Using Redux Toolkit Over Vanilla Redux?

  • Majorly Reduces Boilerplate With Powerful Helper Functions

    • createSlice() - Eliminates the need for a constants/types file & action creators by accepting an initial state, an object full of reducer functions, a "slice name", then automatically generating action creators and action types.

    • configureStore() - Eliminates the need for a separate "root-reducer" file by allowing you to pass in each slice of your state as an object and running combineReducers() automatically for you.

      configureStore also sets up DevTools and popular middleware automatically (see next drop down for more info) and calls applyMiddleware() and compose() for you

  • Includes Popular Middleware & DevTools With No Setup Required

    Prevents common mistakes such as accidentally mutating your state or putting non-serializable data into state (functions, promises, etc. which should be handled separate from the state logic.) by including redux-immutable-state-invariant, serializable-state-invariant-middleware, and allows you to manage side-effects with redux-thunk

    Comes with a getDefaultMiddleware() function if you'd like to add your own middleware but still use the provided defaults.

  • Makes Code More Readable, Testable & Easier to Reason About

    Lets you write easily readable, mutative code, and replaces verbose switch/case statements with readable functions such as

    newPost: (state, action) โ‡’ { const newPost = action.payload state.userPosts.push(newPost) } without actually mutating the state & causing bugs by automatically processing your code with the Immer library.

Beyond Toolkit: Simplifying Redux With React Hooks

  • Before hooks

    The most common way of accessing the store and dispatch functions in React was to use the connect()() function, supply it with a manually-created mapStateToProps & mapDispatchToProps, and then pass a huge assortment of functions & state variables directly in the component props.

Now that we have hooks we can simply import useDispatch() & useSelector from react-redux and access our state & dispatch directly inside our component like

const dispatch = useDispatch()

dispatch(myAction(myPayload))

and

const { myStateVariable } = useSelector(state โ‡’ state.mySlice)

flash-cards's People

Contributors

nickmccurdy avatar jordanwinslow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.