Skip to content

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