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.Posix
timestamp in-scope inFrontend.update
andBackend.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.SessionId
andLamdera.ClientId
are wrapped in typesL.SessionId
andL.ClientId
so that you don't mix them up and footgun yourselfL.SessionDict
: a dictionary that uses ourL.SessionId
type as a keyL.ClientSet
: a set that can containL.ClientId
values
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
lib
folder to your project'selm.json
as a source- If you created a folder
vendor
for all of your submodules, and addedlamdera-extra
as a submodule, that means that you'd need to add a line to thesource-directories
field in yourelm.json
so 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 Lamdera
withimport L
- Follow the compiler and update your types accordingly