npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@seminarcatalog/redux

v1.2.0

Published

Redux bridge for SeminarCatalog API Javascript SDK

Downloads

6

Readme

SeminarCatalog Redux

npm GitHub package.json version David

This project is the official redux bridge for the SeminarCatalog Javascript SDK of the SeminarCatalog developed by the Databay AG.

Table of contents

Installation

yarn

Install this package via yarn:

yarn add @seminarcatalog/redux

npm

Install this package via npm:

npm install @seminarcatalog/redux --save

Getting Started

Please follow the installation instruction and execute the following JS code:

import { combineReducers, createStore } from 'redux';
import promise from 'redux-promise-middleware';
import thunk from 'redux-thunk';
import {ADDRESS} from "@seminarcatalog/redux";

const reducers = combineReducers({
    address: ADDRESS.reducer
});

const store = createStore(reducers, applyMiddleware(thunk, promise));

store
    .dispatch(ADDRESS.actions.LIST())
    .then(() => console.log(ADDRESS.selectors.getList(store.getState()));

Contributing

SeminarCatalog/redux is an open-source project which is mainly developed and maintained by Databay AG. You're interested in checking out how seminarcatalog/redux works and/or want to contribute to this project? Then checkout our contribution guide!

License

This project is licensed under the MIT License. See LICENSE document.

Documentation

Documentation for redux resources

Resource | Api Endpoint | Reducer | Selectors | Actions ------------ | ------------- | ------------- | ------------- | ------------- Address | AddressApi | ADDRESS.reducer | ADDRESS.selectors | ADDRESS.actions AllocationWaitingList | AllocationWaitingListApi | ALLOCATIONWAITINGLIST.reducer | ALLOCATIONWAITINGLIST.selectors | ALLOCATIONWAITINGLIST.actions BookingInterest | BookingInterestApi | BOOKINGINTEREST.reducer | BOOKINGINTEREST.selectors | BOOKINGINTEREST.actions Category | CategoryApi | CATEGORY.reducer | CATEGORY.selectors | CATEGORY.actions Certificate | CertificateApi | CERTIFICATE.reducer | CERTIFICATE.selectors | CERTIFICATE.actions ContactPerson | ContactPersonApi | CONTACTPERSON.reducer | CONTACTPERSON.selectors | CONTACTPERSON.actions Country | CountryApi | COUNTRY.reducer | COUNTRY.selectors | COUNTRY.actions Coupon | CouponApi | COUPON.reducer | COUPON.selectors | COUPON.actions CouponCode | CouponCodeApi | COUPONCODE.reducer | COUPONCODE.selectors | COUPONCODE.actions Currency | CurrencyApi | CURRENCY.reducer | CURRENCY.selectors | CURRENCY.actions EducationHistoryItem | EducationHistoryItemApi | EDUCATIONHISTORYITEM.reducer | EDUCATIONHISTORYITEM.selectors | EDUCATIONHISTORYITEM.actions Event | EventApi | EVENT.reducer | EVENT.selectors | EVENT.actions Hotel | HotelApi | HOTEL.reducer | HOTEL.selectors | HOTEL.actions Language | LanguageApi | LANGUAGE.reducer | LANGUAGE.selectors | LANGUAGE.actions Location | LocationApi | LOCATION.reducer | LOCATION.selectors | LOCATION.actions Media | MediaApi | MEDIA.reducer | MEDIA.selectors | MEDIA.actions Order | OrderApi | ORDER.reducer | ORDER.selectors | ORDER.actions Organizer | OrganizerApi | ORGANIZER.reducer | ORGANIZER.selectors | ORGANIZER.actions Participant | ParticipantApi | PARTICIPANT.reducer | PARTICIPANT.selectors | PARTICIPANT.actions Participation | ParticipationApi | PARTICIPATION.reducer | PARTICIPATION.selectors | PARTICIPATION.actions ParticipationCode | ParticipationCodeApi | PARTICIPATIONCODE.reducer | PARTICIPATIONCODE.selectors | PARTICIPATIONCODE.actions Partner | PartnerApi | PARTNER.reducer | PARTNER.selectors | PARTNER.actions PaymentMethod | PaymentMethodApi | PAYMENTMETHOD.reducer | PAYMENTMETHOD.selectors | PAYMENTMETHOD.actions Price | PriceApi | PRICE.reducer | PRICE.selectors | PRICE.actions Product | ProductApi | PRODUCT.reducer | PRODUCT.selectors | PRODUCT.actions ProductVariant | ProductVariantApi | PRODUCTVARIANT.reducer | PRODUCTVARIANT.selectors | PRODUCTVARIANT.actions ProviderInfo | ProviderInfoApi | PROVIDERINFO.reducer | PROVIDERINFO.selectors | PROVIDERINFO.actions Receiver | ReceiverApi | RECEIVER.reducer | RECEIVER.selectors | RECEIVER.actions Region | RegionApi | REGION.reducer | REGION.selectors | REGION.actions Restaurant | RestaurantApi | RESTAURANT.reducer | RESTAURANT.selectors | RESTAURANT.actions RevenueAccount | RevenueAccountApi | REVENUEACCOUNT.reducer | REVENUEACCOUNT.selectors | REVENUEACCOUNT.actions RoleDiscount | RoleDiscountApi | ROLEDISCOUNT.reducer | ROLEDISCOUNT.selectors | ROLEDISCOUNT.actions Seminar | SeminarApi | SEMINAR.reducer | SEMINAR.selectors | SEMINAR.actions SeminarConfiguration | SeminarConfigurationApi | SEMINARCONFIGURATION.reducer | SEMINARCONFIGURATION.selectors | SEMINARCONFIGURATION.actions Subscription | SubscriptionApi | SUBSCRIPTION.reducer | SUBSCRIPTION.selectors | SUBSCRIPTION.actions SubscriptionConfiguration | SubscriptionConfigurationApi | SUBSCRIPTIONCONFIGURATION.reducer | SUBSCRIPTIONCONFIGURATION.selectors | SUBSCRIPTIONCONFIGURATION.actions SubscriptionPlan | SubscriptionPlanApi | SUBSCRIPTIONPLAN.reducer | SUBSCRIPTIONPLAN.selectors | SUBSCRIPTIONPLAN.actions Task | TaskApi | TASK.reducer | TASK.selectors | TASK.actions Test | TestApi | TEST.reducer | TEST.selectors | TEST.actions TestResult | TestResultApi | TESTRESULT.reducer | TESTRESULT.selectors | TESTRESULT.actions Topic | TopicApi | TOPIC.reducer | TOPIC.selectors | TOPIC.actions Trainer | TrainerApi | TRAINER.reducer | TRAINER.selectors | TRAINER.actions User | UserApi | USER.reducer | USER.selectors | USER.actions UserGroup | UserGroupApi | USERGROUP.reducer | USERGROUP.selectors | USERGROUP.actions Vat | VatApi | VAT.reducer | VAT.selectors | VAT.actions VatItem | VatItemApi | VATITEM.reducer | VATITEM.selectors | VATITEM.actions WaitingList | WaitingListApi | WAITINGLIST.reducer | WAITINGLIST.selectors | WAITINGLIST.actions

Documentation for internals

createAsyncAction

A helper function to create a redux action creator function to handle async calls.

function createAsyncAction(type, prepareFn?)

Usually this function is only used internaly. But if you want to create your own async action creator function, you can do this with:

const asyncTopicList = createAsyncAction('topic/list', ({payload}) => ({
payload: () => new Promise((resolve) => setTimeout(() => { resolve (payload) }, 2000))
}));

const action = asyncTopicList('myPayload');
// { type: 'topic/list/request', payload: () => new Promise() }

console.log(action.toString())
// topic/list/request

console.log(`Action name is ${action}`)
// Action name is topic/list/request

console.log(action.onSuccess.toString());
// topic/list/success

console.log(action.onFailure.toString());
// topic/list/failure

The onSuccess action is dispatched, if the payload resolves, otherwise onFailure is dispatched.

createResourceActions

A helper function to create crud action creators for a given resource.

function createResourceActions(resource, apiEndpoint)

This function can be used to create redux crud actions based on a @seminarcatalog/sdk api endpoint.

import {TopicApi} from '@seminarcatalog/sdk';

const topicActions = createResourceActions('topic', TopicApi);

console.log(topicActions);
/*
{
    LIST: Function, // { type: 'topic/list/request', payload: Topic.topicList }
    GET: Function,  // { type: 'topic/get/request', payload: Topic.topicGet }
    CREATE: Function, // { type: 'topic/create/request', payload: Topic.topicCreate }
    UPDATE: Function, // { type: 'topic/update/request', payload: Topic.topicUpdate }
    DELETE: Function, // { type: 'topic/delete/request', payload: Topic.topicDelete }
}
*/

createResourceSelectors

A helper function to create a collection of selector function to select data from state.

function createResourceSelectors(resource)

This function can be used to create a set of selectors for a given resource

const topicSelectors = createResourceSelectors('topic');

const state = { /* the curent state */ };

console.log(topicSelectors.getList(state));
// A list of topics [{id: 1, ...}, {id: 2, ...}]

console.log(topicSelectors.getItem(state, 1));
// A topic {id: 1, ...}

createEntityReducer

A helper function to create the entity reducer for a resource

function createEntityReducer(resource, actions)

This function can be used to create an entity reducer for a set of crud actions and a defined resource. The created reducers reduces the state for the resource onSuccess list, get, create, update or delete action.

const action = createResourceActions('topic');
const topicReducer = createEntityReducer('topic', actions);

console.log(topicReducer);
/*
{
    [action.LIST.onSucces]: fn(state, action),
    [action.GET.onSucces]: fn(state, action),
    [action.CREATE.onSucces]: fn(state, action),
    [action.UPDATE.onSucces]: fn(state, action),
    [action.DELETE.onSucces]: fn(state, action)
}
*/

createResourceReducer

A helper function to create a combined reducer for all resource reducers.

function createResourceReducer(resource, actions)

This function can be used to create a combined reducer of all resource reducers. Currently the following reducers are combinded into one resource reducer:

const actions = createResourceActions('topic');
const resourceReducer = createResourceReducer('topic', actions);

console.log(resourceReducer);
/*
{
    entities: createEntityReducer('topic')
}
*/

createReduxResource

A helper function to create a collection object for all redux function of a defined resource.

function createReduxResource(resource, apoEndpoint)

This function is the all-in-one creator function for a resource to create a resource reducer, resource crud actions and resource selectors and collects them in one object. The library uses this function to provide the full functionality for all @seminarcatalog/sdk endpoints.

import {TopicApi} from '@seminarcatalog/sdk';

const TOPIC = createReduxResource('topic', TopicApi);

Appendix

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Build package: de.databay.seminarcatalog.codegen.DatabayReduxGenerator For more information, please visit https://www.databay.de