Skip to content

Releases: CodeYellowBV/mobx-spine

v0.7.1

29 Mar 09:42
Compare
Choose a tag to compare

Fix parsing of Model -> Store -> Model relations (#17)

v0.7.0

27 Mar 10:45
Compare
Choose a tag to compare

Allow to use query parameters on model.save() and model.delete(). Example:

animal.save({ params: { foo: 'bar' } });
// Request to api/animal/?foo=bar

v0.6.0

27 Mar 09:10
Compare
Choose a tag to compare
  • Add skipRequestError option to BinderApi requests.
  • Add skipFormatter option to BinderApi requests.

v0.5.0

23 Mar 10:46
Compare
Choose a tag to compare

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

16 Mar 17:26
Compare
Choose a tag to compare
  • 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 to BinderApi, which gets called for every request error. This is useful if you want to show a notification if a request fails.
  • Return this for model.parse() and store.parse() methods.
  • primaryKey on a model is now static.

v0.3.0

12 Mar 16:12
Compare
Choose a tag to compare
  • Add support for saving nested models with model.saveAll(). This is called "multi-PUT" in the Django Binder stack.

v0.2.2

12 Mar 10:18
Compare
Choose a tag to compare
  • 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' as primaryKey in some places.
  • Throw error if parameter passed to model.parse() or store.parse() is not an object or array (respectively).