Skip to content

amp-bind: Only have one AMP.setState() syntax #8390

@dreamofabear

Description

@dreamofabear

Currently two syntaxes are supported:

  1. AMP.setState(foo='bar')
  2. AMP.setState({foo: 'bar'})

(1) uses the standard action key-value system while (2) delegates the parsing of the object literal to amp-bind. IMO we should remove (1) since it's less powerful and not consistent with Bind expression syntax. Only having one syntax would make the API cleaner and less confusing.

We'd first need to fix all of the example code in the amphtml repo and ampbyexample.com.

/cc @ericlindley-g

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions