This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createCacheManager } from '@zup-next/redux-action-cache' | |
| import resources from './resources' | |
| const { profile, wallet, catalog, order } = resources | |
| const cacheManager = createCacheManager({ | |
| include: [profile.types.LOAD, wallet.types.LOAD, catalog.types.LOAD], | |
| invalidations: [ | |
| { type: 'pattern', invalidatedBy: /(.+)\/LOAD_ERROR$/, invalidated: '$1/LOAD' }, | |
| { invalidatedBy: order.types.CREATE_SUCCESS, invalidated: wallet.types.LOAD }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include: [ | |
| { type: 'pattern', name: /\/LOAD$/ } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createStore, applyMiddleware, combineReducers } from 'redux' | |
| import createSagaMiddleware from 'redux-saga' | |
| import resources from './resources' | |
| import cacheManager from './cache' | |
| import { createEffects, getTypeToSagaMap } from '@zup-next/redux-resource' | |
| import { mapValues } from 'lodash' | |
| const reducers = combineReducers(mapValues(resources, 'reducer')) | |
| export const rootSaga = function* run() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_beagleType_":"text", | |
| "value":"New text comming from BFF" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** | |
| * This file is automatically generated by the BFF. Please, don't change it. To update it, run: | |
| * yarn update-sdui-schema | |
| ***/ | |
| export default interface Schema { | |
| container: { | |
| style?: Record<string, any>, | |
| }, | |
| card: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useContext, useEffect } from 'react' | |
| import useResouce from 'rest-resource' | |
| import InvoiceTable from 'components/InvoiceTable' | |
| import Pagination from 'components/Pagination' | |
| import invoiceContext from './context' | |
| import { Header, PreviousMonth, NextMonth } from './styled' | |
| const InvoiceResult = () => { | |
| const { page, setPage } = useState(1) | |
| const { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState } from 'react' | |
| import YearMonthSelector from './YearMonthSelector' | |
| import InvoiceResult from './InvoiceResult' | |
| import InvoiceDispute from './InvoiceDispute' | |
| const Invoice = () => { | |
| const [year, setYear] = useState() | |
| const [month, setMonth] = useState() | |
| const [refetchInvoice, setRefetchInvoice] = useState() | |
| const [selectedItem, setselectedItem] = useState() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // exemplo mais robusto: providencia um meio de acessar a árvore a partir do contexto do componente | |
| // BeagleContextMiddleware.js | |
| export const BEAGLE_ID_PREFIX = '_beagle_' | |
| export function createBeagleContextMiddleware() { | |
| let id = 1 | |
| const treeReferences = {} | |
| const getTreeInContext = elementRef => treeReferences[elementRef.attributes.id] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "id":1, | |
| "name":"Colton", | |
| "lastName":"Baird", | |
| "gender":"male", | |
| "birthDate":"1880-01-14", | |
| "deathDate":"1945-11-15", | |
| "country":"French Polynesia" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_beagleType_": "container", | |
| "id": "content", | |
| "style": { | |
| "width": "800px", | |
| "height": "100%", | |
| "display": "flex", | |
| "justify-content": "space-around" | |
| }, | |
| "children": [ |