This is the Flyp, Inc.-flavored implementation of the Lamdera platform.
The rationale behind this repository existing in the first place, is that we wanted a separation between our implementation of the Lamdera runtime platform, and the rest of our application.
This makes it easy for John to prototype with platform-level ideas, without breaking the whole application a hundred times between iterations on some unhinged long-shot that may or may not even work out.
- You get a fresh
Time.Posixtimestamp in-scope inFrontend.updateandBackend.update- This makes it easy to do stuff like "put a timestamp on some value that's being persisted in the
BackendModel
- This makes it easy to do stuff like "put a timestamp on some value that's being persisted in the
Lamdera.SessionIdandLamdera.ClientIdare wrapped in typesL.SessionIdandL.ClientIdso that you don't mix them up and footgun yourselfL.SessionDict: a dictionary that uses ourL.SessionIdtype as a keyL.ClientSet: a set that can containL.ClientIdvalues
I've also included a demonstration of how to bring "The Module Pattern" into Lamdera, in ./src/Counter.elm.
Yeah, just hit lamdera live.
Sure, but I'm using this as a base for a product right now, so I'm going to push to master whenever I feel the need to do so; you may want to pin your submodule to a SHA that you're happy with, and roll back if I update something in here that breaks your stuff.
If you have any questions, you can catch me as @lambdapriest on the Lamdera Discord.
To use lamdera-extra in your own Lamdera application:
lamdera install elm/time
- Submodule this repo in your project's repo
- Add the path to this repo's
libfolder to your project'selm.jsonas a source- If you created a folder
vendorfor all of your submodules, and addedlamdera-extraas a submodule, that means that you'd need to add a line to thesource-directoriesfield in yourelm.jsonso that it looked like this when you were done:"source-directories": [ "src", "vendor/lamdera-extra/lib" ],
- If you created a folder
- Read the docs: There are lots of doc comments in the modules within
./lib, as well as inCounter.elm. - Replace all existing references to
import Lamderawithimport L - Follow the compiler and update your types accordingly