Warning: The magic method SFML_Singleton::__wakeup() must have public visibility in /home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php on line 72
js-data – Thoughts, etc.

Thoughts, etc.

Tracking the occasional random walk

js-data

Side effects of js-data-http and async operations

2018-06-15 / Leave a Comment

Recently I encountered a rather strange scenario, wherein I created two different  findAll operations using the js-data-http adapter for a js-data query, only to see two identical network requests emitted. The root of the problem turned out to be that I was creating a single object to hold the query options and reusing it across requests, in … [Read more…]

Posted in: code, front-end Tagged: js-data

Adding Vue reactivity to js-data relationships

2018-05-16 / 3 Comments

While attempting to have Vue components react to changes in my js-data model instances and their relationships, I found a great post from Caleb Roseland with an accompanying code example. They detail how to make model properties reactive in Vue, without overriding js-data’s own reactivity. What they don’t discuss is how to make Vue react … [Read more…]

Posted in: front-end Tagged: js-data, vue

What to do if js-data serializes array elements as empty objects

2018-04-30 / Leave a Comment

TL;DR: Use the items validation keyword to specify the data type of the elements of arrays in your js-data schema to avoid unexpected results when serializing records, e.g. for saving. The setup I was using js-data v3 with a schema containing an array field recently, and came across some initially baffling behaviour. I had a fooSchema … [Read more…]

Posted in: code Tagged: js-data