Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom resource APIs #878

Merged
merged 6 commits into from
Feb 5, 2021
Merged

Conversation

agubler
Copy link
Member

@agubler agubler commented Feb 2, 2021

Type: feature

The following has been addressed in the PR:

Description:

Extends dojo resources to support defining and providing custom APIs in a resource template. With additional support for updating/creating data within a resource.

Creating a template with a custom API

const template = createResourceTemplate<Data, { save: (item: Data) => void }>({
    idKey: 'id',
    save: (item, controls) => {
        controls.push([item]);
    }
});

Create resource middleware that defines a custom API

const resource = createResourceMiddleware<Data, { save: (item: Data) => void }>()

@agubler agubler added area: core Core enhancement New feature or request labels Feb 2, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 2, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8777307:

Sandbox Source
dojo/dojo-codesandbox-template Configuration

@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #878 (f50fff3) into master (820d3bc) will decrease coverage by 0.12%.
The diff coverage is 91.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #878      +/-   ##
==========================================
- Coverage   94.58%   94.46%   -0.13%     
==========================================
  Files         127      127              
  Lines        7959     7999      +40     
  Branches     1859     1871      +12     
==========================================
+ Hits         7528     7556      +28     
- Misses        431      443      +12     
Impacted Files Coverage Δ
src/testing/renderer.ts 97.32% <ø> (ø)
src/core/middleware/resources.ts 94.36% <91.89%> (-2.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 820d3bc...8777307. Read the comment docs.

@agubler agubler changed the title WIP: Support for custom resource APIs Support for custom resource APIs Feb 5, 2021
@agubler agubler merged commit a0cd7a0 into dojo:master Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Core enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants