What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-05 19:33:02
module system in javascript
// Default exports //Function.js// export default () => console.log("Hello"); export default someValue = 10; //Main.js// import oneFunc from './Function'; oneFunc(); // Hello import value from './Function'; console.log(value) // 10 // Na... Add solution -
Javascript 2021-09-04 21:25:01
selector for redux
import { createSelector } from 'reselect'; const getProducts = state => state.products.itemsById; const getCartItemIds = state => state.currentUser.shoppingCart.itemIds; export const selectShoppingCartItems = createSelector( getProducts, getCa... Add solution -
Javascript 2021-09-04 17:10:01
using redux with hooks
import React from "react"; import { useDispatch, useSelector } from "react-redux"; import { addCount } from "./store/counter/actions"; export const Count = () => { const count = useSelector(state => state.counter.cou... Add solution -
Javascript 2021-09-04 09:18:02
redux saga fetch json
//EXAMPLE FETCH DATA API REDUX SAGA // USER ACTION CREATOR export const REQUEST_API_DATA = 'REQUEST_API_DATA' export const RECEIVE_API_DATA = 'RECEIVE_API_DATA' export const requestApiData = () => ({ type: REQUEST_API_DATA }) // USER REDUCER import ... Add solution