???? Good Things Come to Those Who Wait: What’s new in Akita v2

Multiple Active SupportAs you may know, Akita’s Entity Store supports having an active attribute, which holds the active entity’s id.

This can prove to be very useful in cases where you want to interact with the entity that is currently active.

In this release, we added support for maintaining a list of active entities instead of one.

Let’s see how it works:The only actions we need to do, is extend the MultiActiveState interface and initialize the active property to an array.

With this setup, we’ll get the following functionality:Here is a live example for caching the selected entities when navigates to a different page:????.New SelectorsWe’ve added two selectors to Akita’s Entity Query, which simplify the process of selecting the first and last entity in a collection.

For example:In addition to that, the selectMany selector now supports projection function:????.MiscellaneousWe’ve deprecated the getSnapshot() query method in favor of getValue().

The filterNil operator is strongly typed now, which means that the next operator in the chain will not be typed as null or undefined.

✍️ What’s NextIn the next release, we’ll add asynchronous support to the persistState plugin.

This feature has already been submitted as a pull request, but we want to test it further.

This will give you the option to save a store’s value to a persistent storage, such as indexDB, websql, or any other asynchronous API.

Akita with localForageAkita continues to grow with more than 150k downloads so far.

We’re getting a lot of great feedback, and we’re always open to new suggestions and improvements.

You’re welcome to join Akita’s Gitter channel to address any questions you may have.

I’d like to thank Inbal Sinai and the rest of the contributors, who help make Akita better.

.. More details

Leave a Reply