benjamn / optimism

Composable reactive caching with efficient invalidation.
MIT License
113 stars 19 forks source link

Documentation #63

Open mvastola opened 4 years ago

mvastola commented 4 years ago

This is an extremely popular node module, yet I have no idea what it does (beyond the one-line description), or how to use it. I think it might be what I need for a project based on this description, but it's very hard to tell given the lack of any information about it anywhere on the internet.

It seems to only have a few main functions that are widely used. Would it be possible for them to be documented?

anka-213 commented 4 years ago

Do you have any specific questions relating to your use case? It could be a good starting point for writing documentation.

You could also look at the tests here for a few examples of how to use the library:

Here is an example of some simple usage: https://github.com/benjamn/optimism/blob/5cb169552d10b28fff0898ba5fa1728175c0e9d6/src/tests/api.ts#L502-L512

Here is another example with some more intricate behaviour: https://github.com/benjamn/optimism/blob/5cb169552d10b28fff0898ba5fa1728175c0e9d6/src/tests/api.ts#L196-L215