Releases: 92green/enty
Brisk Bat
-
BREAK: remove resultResetOnFetch
It was superseded by the refetching state on RequestStates -
BREAK: split immutable schemas out to their own package
-
BREAK: stop auto-generating a result key
-
BREAK: use an internal function to create response key hash
-
feat: add message response get methods
-
feat: move entities onto sub key. Update tests.
-
feat: move Map and List schema to enty-immutable package
-
feat: unflatten api, add EntitiyProvider, move redux to deps
-
fix: reqestionActionName should be defined when creating hocks
-
fix: stop state mutation by cloning entities and removing singleton
Fix: Fallback to use nextResultKey on mount
Fix: Perf gains
- Do less
.keySeq
for better performance - Fix bug where objectschema would mutate on denormalize
Fix: Default payload creator will return an empty object
react-enty@0.6.1 react-enty@0.6.1
Feature: mapResponseToProps
- Add mapResponseToProps to RequestHock config to hoist response data straight on to props
Feature: Message constructor functions
- Add message constructor functions to let you force a message state.
Enty Core.
Enty is now split across two packages.
The schemas are found at enty
The react binding can be found at react-enty
Add updateResultKey to hock options to allow render control of resultKey
Three kinds of hock stages: Factory, Applier, Component.
If you use 1 applier for different components they will all get the same
result key. updateResultKey is a thunk in the the applier that lets
components use props to override or extend the resultKey generated by the
applier.
Fix resultKey hash generation
BREAKING:
QueryHock signature is now
Hock(queryCreator: Function, propUpdatePaths: Array<string>);
// or
Hock(queryCreator: Function, hockOptions: Object);
propUpdatePaths
can be passed in as a key on hockOptions
MultiHocks, Zero Assumption Entities, Composite Entity, Schemas Used
BREAKING:
EntitySchemas no longer contain constructors or merge functions.
- These are now defined through structural schemas.
- Entities without a definition will throw an error. (You must provide an empty structural schema if the entity has no relationships)
The reasoning behind this change is that entities are conceptually just atype
and anid
. It therefore makes more sense for the structural schema to define the structure and relationships of the entity. This allows you to have any kind of data shape in your entities.
// Old
const user = EntitySchema('user', {
constructor: (user) => new UserRecord(user)
});
// new
const user = EntitySchema('user')
.define(ObjectSchema({}, {
constructor: (user) => new UserRecord(user)
});
ADDED:
CompositeEntitySchema
MultiHocks
MISC:
- Added List/Map schemas (In preparation for an actual array and object schema)
Schema.normalize
keeps track of what schemas are used in a normalize. EntityReducer then stores that in state, so EntitySelectors can select entity data without it being in the root schema.