Skip to main content

web-utilities

A smorgasbord of utility functions used by our other packages. You do not have to use this package, but feel free to if you like.

Observable

A tiny implementation of the Observable- or Pub-Sub-pattern. We use this extensively in the babylon-view.

GenericCache

A simple in memory cache implementation. Mostly we use it to make it semantically clearer when we cache.

PromiseCache

A memory cache containing promises, which may be fulfilled or not. Use this for example if you want to avoid multiple request being sent for the same content.

Will automatically remove the item from the cache if the promise rejects.

encodeURIComponents

Convenience function to encode URI-segments correctly for our API:s.