Optimize KnockoutJs Pagination Computed Function
Let's take a look at that first line of the PageDirection function:

var self = this;


This is a common practice to keep a reference to the this object within the closure. A different way to do this would be to bind the context of the closure using Function.bind()
this.disabled = function (currentPage, lastPage) {
    return this.value() &gt; lastPage || this.value() &lt; 1 || this.value() == null;
}.bind(this);

However, there appears to be no need to bind the context


function PageDirection(data) {
    this.display = data.display;
    this.value = data.value;        
    this.disabled = function (currentPage, lastPage) {
        console.log('this.value: ', this.value(), ' &gt; lastPage: ', this.value() &gt; lastPage);
        return this.value() &gt; lastPage || this.value() &lt; 1 || this.value() == null;
    };
}

const pd1 = new PageDirection({value: _ =&gt; 16, display: 'BMW'});
console.log('pd1 disabled: ', pd1.disabled(1, 10));



Though maybe the KO code invokes that method differently, in which case the function may need to be bound.
Another option would be to use an ES6 arrow function expression, which doesn't have its own this binding:
this.disabled = (currentPage, lastPage) =&gt; 
                this.value() &gt; lastPage || this.value() &lt; 1 || this.value() == null;


To be honest, the logic in the observable looks a bit overly-complex. I didn't fully study it and grok it but I would look to see if some of the logic can be simplified - for example:

} else {
    if (pageIndex &gt; 4) {


Unless it is the case that the subsequent logic wouldn't work you might consider if that can be converted to:
} else if (pageIndex &gt; 4) {

Which could decrease the sub-sequent indentation levels.