bahmutov / bahmutov/iframe-api

Instead of simple api object allow function that returns an object given options from the other side

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
36
Forks
9
PR merge metrics
No merged PRs in 30d

Description

To allow returning different api by version, allow function

``` js
iframeApi(myApi).then(...);
function myApi(clientOptions) {
switch (clientOptions.version) {
case '0.1.0':
return { foo: ...}
break;
case '0.2.0':
return { bar: ...}
break;
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.