Makie/Observable: `@lift` and type

Basically, I want to write my plotting functions in such a way that they work whether the arrays to be plotted are Observables or not. This enables me to use my snapshot-producing functions in creating movies.

For this purpose, I currently use @lift when some operations are necessary on the array before plotting, but then I’ve noticed that the array returned by @lift doesn’t necessarily have the right types. To illustrate what I mean, I’ve created the following toy program:

using Makie # Observables
using OffsetArrays
const nooffs = OffsetArrays.no_offset_view

oa = zeros(-1:2, 0:4)
oa_obs = Observable(oa)
@show typeof(oa), typeof(oa_obs)

b     = nooffs(oa) # OffsetArray -> Array
@show typeof(b)
bb    = @lift(nooffs($oa))
@show typeof(bb)
b_obs = @lift(nooffs($oa_obs))
@show typeof(b_obs)

The strange thing is that no_offset_view doesn’t work under @lift: bb is still an OffsetArray.

In the above example, I apply @lift to an array that is not an Observable to use the same code whether the array is an Observable or not.

Of course, the simplest workaround is to call my plotting function always with an Observable array even when producing a snapshot.

So, why does @lift work like that? Is there another function that I should use in place of @lift ?