New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is ractive.get supposed to return the original form of the data? #3112

fskreuz opened this Issue Oct 20, 2017 · 0 comments


None yet
1 participant

fskreuz commented Oct 20, 2017


Instead of a long description, a picture paints a thousand words.


The adaptor specifically tells Ractive to preserve the model when reset with a POJO on the adapted keypath. Therefore, a ractive.get() after a ractive.set with a POJO on the adapted keypath should return the Backbone model.


  • ractive.get() returns the model (model1)
  • ractive.get() with unwrap: false returns the POJO representation (model2).
  • Adaptor would still work, updating in both directions.


  • Both ractive.get() return the POJO after a ractive.set() (model3 and model4)
  • Adaptor still works on the same model.

Digging in, it seems that after the ractive.set(), the value (holds the POJO version) and wrapperValue (holds the original data) are now both holding the POJO value.

Versions affected:

0.7.3 and newer


<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
const model = new Backbone.Model({ message: 'hello' })
const instance = Ractive({ adapt: [ 'Backbone' ], data: { model } })

const model1 = instance.get('model')
const model2 = instance.get('model', { unwrap: false })
instance.set('model', { message: 'world' })
const model3 = instance.get('model')
const model4 = instance.get('model', { unwrap: false })

t.strictEqual(instance.get('model'), model)
t.strictEqual(instance.get('model.message'), model.get('message'))

@fskreuz fskreuz changed the title from Adaptor replacing adapted data with POJO... even when I told it not to to Is ractive.get supposed to return the original form of the data? Oct 20, 2017

fskreuz added a commit that referenced this issue Oct 21, 2017

@evs-chris evs-chris closed this in 08420db Oct 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment