Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

Are serializeQueryParam and deserializeQueryParam hooks public?

$
0
0

@ykaragol wrote:

According to the documentation, serializeQueryParam and deserializeQueryParam hooks are private. But I saw suggestions to override this hooks.

Further, why is the default implementation doesn't serialize plain javascript objects (such as {x:2,y:4})?

I found the following code from the repo:

  _serializeQueryParam(value, type) {
    if (type === 'array') {
      return JSON.stringify(value);
    }

    return `${value}`;
  },

Why is it not returning JSON.stringify(value) for all objects?
What are the side effects of overriding the hooks by using JSON.stringify(value)?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles