rsm-hcd / hcd-javascript

This is a monorepo consisting of numerous core JavaScript packages utilized by engineers within the Human-Centered Design group at RSM.
https://rsm-hcd.github.io/hcd-javascript/
MIT License
0 stars 1 forks source link

Service Factory - Service Hooks #141

Closed myty closed 7 months ago

myty commented 7 months ago

Adds service factory service hooks such as (useGetService, useListService, useDeleteService, useCreateService, and useUpdateService)

Adds sample todo application for service hook examples.

Apologies for it being a little on the large side. 😬

Simple usage example:

const TodoService = {
    list: ServiceFactory.list(TodoRecord, "api/todos"),
};

function App() {
    const { results } = useListService(TodoService.list);

    return (
        <ul>
            {results.map(r => <li>{r.description}</li>)}
        </ul>
    );
}
changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: 5a48cd915d8f46318bb12d1c74918f2ff8b4e7d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------------------- | ----- | | @rsm-hcd/javascript-react | Minor | | todo | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR