
import { DisposableStore } from '../../common/lifecycle.js';
import '../../common/observableInternal/index.js';
import { createStyleSheet2 } from '../domStylesheets.js';
import { autorun } from '../../common/observableInternal/reactions/autorun.js';

function createStyleSheetFromObservable(css) {
    const store = ( new DisposableStore());
    const w = store.add(createStyleSheet2());
    store.add(autorun(reader => {
        w.setStyle(css.read(reader));
    }));
    return store;
}

export { createStyleSheetFromObservable };
