Skip to content

Commit

Permalink
Add createLibraryAsync() for async creation
Browse files Browse the repository at this point in the history
This new function is a just a convenience wrapper around createLibrary(). Instead of immediately returning the library, it waits until the library is initialized.
  • Loading branch information
flekschas committed Feb 12, 2022
1 parent a7e1a5f commit f128b3f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 743 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## Next

_[Changes since v0.9.1](https://github.com/flekschas/piling.js/compare/v0.9.1...master)_
_[Changes since v0.9.1](https://github.com/flekschas/piling.js/compare/v0.10.0...master)_

## v0.10.0

- Added `createLibraryAsync()` to automatically wait until piling is fully initialized. The function takes as input the same parameters as `createLibrary()`.

_[Changes since v0.9.0](https://github.com/flekschas/piling.js/compare/v0.9.1...v0.10.0)_

## v0.9.1

Expand Down
6 changes: 6 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ An array of objects with one required property `src` and other optional user-def

**Returns:** a new piling instance.

### createLibraryAsync(_domElement_, _initialProperties_)

**Arguments:** Same as [`createLibrary()`](#createlibrarydomelement-initialproperties).

**Returns:** a promise resolving to the new piling instance once the library was initialized.

### createLibraryFromState(_domElement_, _initialProperties_, _options_)

**Arguments:**
Expand Down
Loading

0 comments on commit f128b3f

Please sign in to comment.