Sha256: 7e276fe71b78c8bcc47f5918d44e4abe8ab9642567e6cfca4155e0c408658b70

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 Bytes

Contents

import { assign } from '@ember/polyfills';
import { shallowEqual } from '../utils';
export default class RouterState {
    constructor(emberRouter, router, routerJsState) {
        this.emberRouter = emberRouter;
        this.router = router;
        this.routerJsState = routerJsState;
    }
    isActiveIntent(routeName, models, queryParams, queryParamsMustMatch) {
        let state = this.routerJsState;
        if (!this.router.isActiveIntent(routeName, models, undefined, state)) {
            return false;
        }
        if (queryParamsMustMatch && Object.keys(queryParams).length > 0) {
            let visibleQueryParams = assign({}, queryParams);
            this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams);
            return shallowEqual(visibleQueryParams, state.queryParams);
        }
        return true;
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/routing/lib/system/router_state.js