How to use the serializr.serialize function in serializr

To help you get started, we’ve selected a few serializr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mobxjs / mobx / test / base / decorate.js View on Github external
const obj = deserialize(Obj, {
        x: 0
    })

    const d = autorun(() => {
        updatedByAutorun = obj.x
    })

    expect(isObservableProp(obj, "x")).toBe(true)
    expect(updatedByAutorun).toEqual(0)

    obj.x++

    expect(obj.x).toEqual(1)
    expect(updatedByAutorun).toEqual(1)
    expect(serialize(obj).x).toEqual(1)

    d()
})
github ksandin / darkestdungeon / src / state / AppState.ts View on Github external
save () {
    const jsProfileList = [];
    for (const profile of this.profiles.map.values()) {
      jsProfileList.push(serialize(profile));
    }

    localStorage.setItem('profileList', JSON.stringify(jsProfileList));
    console.log('Saved');
  }
github lennerd / git-for-beginners / src / tutorial.js View on Github external
autorun(() => {
  const deserializedTutorialState = serialize(tutorialState);

  localStorage.setItem(sessionId, JSON.stringify(deserializedTutorialState));
});
github pinqy520 / mobx-persist / src / index.ts View on Github external
            () => serialize(schema, store),
            (data: any) => storage.setItem(key, !jsonify ? data : JSON.stringify(data)),
github nathanstitt / mobx-decorated-models / dist / build.module.js View on Github external
serialize: function serialize$$1() {
        var schema = getDefaultModelSchema(this.constructor);
        return serialize(schema, this);
    },
    update: function update$$1(json, callback) {
github fluid-notion / fluid-outliner / core / views / models / RouteViewModel.ts View on Github external
public get serializedQuery() {
        return qs.stringify(serialize(this))
    }
github nathanstitt / mobx-decorated-models / lib / class-decorator.js View on Github external
serialize() {
        const schema = getDefaultModelSchema(this.constructor);
        return serialize(schema, this);
    },
    update(json, callback) {
github pinqy520 / mobx-persist / lib / index.js View on Github external
        mobx_1.reaction(function () { return serializr_1.serialize(schema, store); }, function (data) { return storage.setItem(key, !jsonify ? data : JSON.stringify(data)); }, {
            delay: debounce