Changes types for serialize method to return a string
Changes the type of deserialize method to take a string
Adds an optional parameter to deserialize function to take the knob component, so that its options can be matched against the serialized value.
NOTE: In this PR I primarily focused on the 'Select' knob as that's the one mentioned in the bug. I tried to fix the other ones, too, but didn't focus too deeply on them.
Tested
Added unit tests for serialization/deserialization
Manually verified that copying a link and pasting it populates complex values onload.
Description
Fixes https://github.com/storybookjs/addon-knobs/issues/1
serialize
method to return a stringdeserialize
method to take a stringdeserialize
function to take the knob component, so that itsoptions
can be matched against the serialized value.NOTE: In this PR I primarily focused on the 'Select' knob as that's the one mentioned in the bug. I tried to fix the other ones, too, but didn't focus too deeply on them.
Tested
Added unit tests for serialization/deserialization Manually verified that copying a link and pasting it populates complex values onload.