Redux extension for RESTfull api communications and data management
npm install redux-restifyThis is a redux based framework for managering api entities and application forms.
Check out the docs for more info.
validateAll form config optiontransformBeforeSubmit option to form configgetByUrl and asyncGetByUrl methods to EntityList. Also, you can define apiName in configtransformBeforeSubmit can be a function (formValues) => data. Can be used to send arraysgetForm(and others) selectors. Returns object with matched form name keysgetFormActions. Returns object with form name keysRestifyForeignKey and RestifyForeignKeysArray can be set for plain id fields, or even for changing behaviour from model to id fields. They will return model by auto-request anywaymapServerDataToIds option to form config. applyServerData now can respects form model field and map models into ids for sending to serverallowIdRequests option to api modelgetToken can now return PromisegetIsLoadingById and getIsLoadingArrray returns true, if the url is not registered in loadsManagerallowNested param for foreign key respects all models, not only self-recursiveclearData action to entityManager, so we can clear all api data for model. Useful for cases, when we want to forget some corrupted entities loaded.clearDataOnRouteChange setting for model, so we can clear all model data on route changesfetchConfig to RestifyLinkedModel. This config will be applied in linkedModel.getById(transformArrayResponse and getEntityUrl to api and model configscrudAction and specialAction to getEntityUrl, now getEntityUrl can return an object with utl and methodtransformEntityResponse to api and model configs$modelType field to all restify modelsclearPagesOnRouteChange setting for model, so we can config default clearing pages on route changesmodelConfig setting for getArray and other array getters, allowing to tweak model config for given requestRestifyField base field class. Does not have any functionality yet, but can be used to give a field a verbose name and default valueswarnAboutUnregisteredFields option to model configonXhrReady callback for api callsRestifyGenericForeignKey for gereric relationsforceLoad option for arraysgetPaginationQuery option for model and api configgetHeaders option for xhr adaptertrasformedValues argument to transformBeforeSubmit function, so you can use values with applied fakeId, submitExclude and other default transformsquery param into form config, so you can send forms to endpoints with query paramsauthMethod option to api configwithCredentials param for api configskipLoadsManager config param for grneral api actionsuseSnakeCase api parameter, so we can disable snake_case convertation for apiasyncGetById also has async getters for missing model fieldstransformErrorResponse functionuseOptimisticUpdate config to formparentEntities config to getByIdhasById selectorkey and data params to generic fieldsuseOptimistic parameter to deleteById action. Use, if you want to show element deletion progress.retries retryTimeoutMs options to restify config, so user can define default reties behaviourtrackDirtyFields and submitOnlyDirtyFields options to form config (see docs)apiConfig field to form config, allowing to override api settings, like getToken etc.updateRestify for dynamic add models and forms
updateRestify({
apiDefinitions,
modelsDefinitions,
formsDefinitions,
onUpdateRestify: () => {
RESTIFY_CONFIG.store.replaceReducer(getReducer())
},
})
`$3
1. Added boolean clearOldPages parameter(default - true) to clearPages actions. If passed false, oldPages are not cleared by this actions, so data can still be displayed, while loading new one.$3
1. Return a Promise resolving to true from httpCodesCallback to retry a request$3
1. Added boolean clearOldSingleEntities parameter(default - true) to clearData actions. If passed false, oldSingleEntities are not cleared by this actions, so data can still be displayed, while loading new one.$3
1. Added support for unregistered parents for models$3
1. Added $old key to RestifyModel, for detecting old data being updated at the moment$3
1. Added opportunity to return promise from onXhrReady$3
1. Added pagination parameter to getPaginationQuery option$3
1. Added request data to code callbacks function call$3
1. Added preventAutoGetters option to getById$3
1. Added invokeBaseCallbacks to httpCodesCallbacks api config option for easier overrides$3
1. Export low-level api calculateValidationResult for validation customisation$3
1. Added updateEntityManagerData action$3
1. Added withPages and apiConfig options to RestifyForeignKeysArray action, allowing to store model fields with links to custom filtering configs$3
1. Added preventLoad option to getArrayConfig
2. Added useRequestsLock api and withRequestsLock option to RestifyForeignKeysArray`