How to use the @jupyterlab/observables/src.ObservableJSON function in @jupyterlab/observables

To help you get started, we’ve selected a few @jupyterlab/observables 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 jupyterlab / jupyterlab / tests / test-observables / src / observablejson.spec.ts View on Github external
it('should create an observable JSON object', () => {
        const item = new ObservableJSON();
        expect(item).to.be.an.instanceof(ObservableJSON);
      });
github jupyterlab / jupyterlab / tests / test-observables / src / observablejson.spec.ts View on Github external
it('should return a copy of the data', () => {
        const item = new ObservableJSON();
        item.set('foo', { bar: 1 });
        const value = item.toJSON();
        value['bar'] = 2;
        expect((item.get('foo') as any)['bar']).to.equal(1);
      });
    });
github jupyterlab / jupyterlab / tests / test-observables / src / observablejson.spec.ts View on Github external
it('should serialize the model to JSON', () => {
        const item = new ObservableJSON();
        item.set('foo', 1);
        expect(item.toJSON()['foo']).to.equal(1);
      });