How to use the @jupyterlab/observables/src.ObservableValue 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 yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should be emitted when the map changes state', () => {
        let called = false;
        const value = new ObservableValue();
        value.changed.connect(() => {
          called = true;
        });
        value.set('set');
        expect(called).to.equal(true);
      });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should get the value of the object', () => {
        const value = new ObservableValue('value');
        expect(value.get()).to.equal('value');
        const value2 = new ObservableValue({ one: 'one', two: 2 });
        expect(
          JSONExt.deepEqual(value2.get(), { one: 'one', two: 2 })
        ).to.equal(true);
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should accept no arguments', () => {
        const value = new ObservableValue();
        expect(value instanceof ObservableValue).to.equal(true);
        expect(value.get()).to.be.null;
      });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should test whether the value is disposed', () => {
        const value = new ObservableValue();
        expect(value.isDisposed).to.equal(false);
        value.dispose();
        expect(value.isDisposed).to.equal(true);
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should accept an initial JSON value', () => {
        const value = new ObservableValue('value');
        expect(value instanceof ObservableValue).to.equal(true);
        const value2 = new ObservableValue({ one: 'one', two: 2 });
        expect(value2 instanceof ObservableValue).to.equal(true);
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should have value changed args', () => {
        let called = false;
        const value = new ObservableValue();
        value.changed.connect((sender, args) => {
          expect(sender).to.equal(value);
          expect(args.newValue).to.equal('set');
          expect(args.oldValue).to.be.null;
          called = true;
        });
        value.set('set');
        expect(called).to.equal(true);
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should get the value of the object', () => {
        const value = new ObservableValue('value');
        expect(value.get()).to.equal('value');
        const value2 = new ObservableValue({ one: 'one', two: 2 });
        expect(
          JSONExt.deepEqual(value2.get(), { one: 'one', two: 2 })
        ).to.equal(true);
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should accept an initial JSON value', () => {
        const value = new ObservableValue('value');
        expect(value instanceof ObservableValue).to.equal(true);
        const value2 = new ObservableValue({ one: 'one', two: 2 });
        expect(value2 instanceof ObservableValue).to.equal(true);
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should return `Value`', () => {
        const value = new ObservableValue();
        expect(value.type).to.equal('Value');
      });
    });
github yuvipanda / simplest-notebook / tests / test-observables / src / modeldb.spec.ts View on Github external
it('should set the value of the object', () => {
        const value = new ObservableValue();
        value.set('value');
        expect(value.get()).to.equal('value');
      });
    });