(() => {
                        const alertImg = new Image();

                        alertImg.src = ServerMapTheme.general.common.funcServerMapImagePath(ServerMapTheme.general.common.icon.error);
                        return zip(
                            serviceTypeImgLoadEvent$.pipe(pluck('target')),
                            fromEvent(alertImg, 'load').pipe(pluck('target'))
                        );
                    })(),
 /**
  * Get url by id
  *
  * @param string id
  * @returns Observable<string>
  * @memberof ContentletService
  */
 getUrlById(id: string): Observable<string> {
     return this.getContentTypes().pipe(
         flatMap((structures: StructureTypeView[]) => structures),
         pluck('types'),
         flatMap((contentTypeViews: ContentTypeView[]) => contentTypeViews),
         filter(
             (contentTypeView: ContentTypeView) =>
                 contentTypeView.variable.toLocaleLowerCase() === id
         ),
         pluck('action')
     );
 }
 ngOnInit() {
   this.route.data
     .pipe(pluck('nextMatch', 'data'))
     .subscribe((d: any) => {
       this.router.navigate(this.matchRunnerRoute.matchRunnerRoute(d));
     });
 }
 pluck1() {
   const source = from([{ name: 'Joe', age: 30 }, { name: 'Sarah', age: 35 }]);
   // grab names
   const example = source.pipe(pluck('name'));
   // output: "Joe", "Sarah"
   const subscribe = example.subscribe(val => console.log(val));
 }
Vue.prototype.$observe = function(fn, options = {}) {
  const vm = this;
  const obs$ = Observable.create(observer => {
    let _unwatch;
    const watch = () => {
      _unwatch = vm.$watch(
        fn,
        (newValue, oldValue) => {
          observer.next({ oldValue: oldValue, newValue: newValue });
        },
        { immediate: true, ...options }
      );
    };

    // if $watchAsObservable is called inside the subscriptions function,
    // because data hasn't been observed yet, the watcher will not work.
    // in that case, wait until created hook to watch.
    if (vm._data) {
      watch();
    } else {
      vm.$once("hook:created", watch);
    }

    // Returns function which disconnects the $watch expression
    return () => _unwatch && _unwatch();
  });
  return obs$.pipe(pluck("newValue"));
};
 /**
  * Unlock a content asset
  *
  * @param string inode
  * @returns Observable<any>
  * @memberof PageViewService
  */
 unlock(inode: string): Observable<any> {
     return this.coreWebService
         .requestView({
             method: RequestMethod.Put,
             url: `content/unlock/inode/${inode}`
         })
         .pipe(pluck('bodyJsonObject'));
 }
 /**
  * Updates the workflow actions for a page asset
  *
  * @param string inode
  * @returns Observable<any> // contentlet
  * @memberof DotWorkflowService
  */
 fireWorkflowAction(inode: string, actionId: string): Observable<any> {
     return this.coreWebService
         .requestView({
             method: RequestMethod.Put,
             url: `v1/workflow/actions/${actionId}/fire?inode=${inode}`
         })
         .pipe(pluck('entity'));
 }
 /**
  * Returns the wokflow or workflow actions for a page asset
  *
  * @param string inode
  * @returns Observable<DotWorkflowAction[]>
  * @memberof DotWorkflowService
  */
 getContentWorkflowActions(inode: string): Observable<DotWorkflowAction[]> {
     return this.coreWebService
         .requestView({
             method: RequestMethod.Get,
             url: `v1/workflow/contentlet/${inode}/actions`
         })
         .pipe(pluck('entity'));
 }
Beispiel #9
0
 loadFieldTypes(): Observable<FieldType[]> {
     return this.coreWebService
         .requestView({
             method: RequestMethod.Get,
             url: 'v1/fieldTypes'
         })
         .pipe(pluck('entity'));
 }
Beispiel #10
0
 private getLicense(): Observable<any> {
     return this.coreWebService
         .requestView({
             method: RequestMethod.Get,
             url: this.licenseURL
         })
         .pipe(pluck('entity', 'config', 'license'));
 }