Releases: CodeYellowBV/mobx-spine
Releases · CodeYellowBV/mobx-spine
v0.7.1
v0.7.0
v0.6.0
v0.5.0
Add attribute casting. This is e.g. handy when you want to enforce that an attribute is always a moment
object, and when it is sent to the backend you want it to be a ISO-8601 string.
mobx-spine comes with two cast types at the moment datetime
and date
. Checkout the source code to see how easy it is to make your own cast.
import { Model, Casts } from 'mobx-spine';
class Animal extends Model {
@observable bornAt = null;
casts() {
return {
bornAt: Casts.datetime,
};
}
}
v0.4.0
- Stores now only accept one argument, which are the
options
. - When calling
model.delete()
, it will now do a non-optimistic delete by default, meaning the model will only be removed from the store (if any), when the request is finished. Add{ immediate: true }
for the old behavior. - Add
onRequestError
method toBinderApi
, which gets called for every request error. This is useful if you want to show a notification if a request fails. - Return
this
formodel.parse()
andstore.parse()
methods. primaryKey
on a model is now static.
v0.3.0
v0.2.2
- Binder Api: Throw error when a model or store url does not end with a trailing slash.
- Move implementation detail of Binder to Binder Api class.
- Remove hardcoded
'id'
asprimaryKey
in some places. - Throw error if parameter passed to
model.parse()
orstore.parse()
is not an object or array (respectively).