mirror of
https://github.com/TylorS/purescript-stream.git
synced 2024-07-14 09:40:34 +03:00
docs(README): add basic readme
This commit is contained in:
parent
1369ee8af5
commit
3773a5e997
28
README.md
Normal file
28
README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Purescript Stream
|
||||
|
||||
> An ultra-fast reactive stream library for purescript
|
||||
|
||||
## Let me have it
|
||||
```sh
|
||||
bower install --save purescript-stream
|
||||
```
|
||||
|
||||
## Basic usage
|
||||
```purescript
|
||||
module Main where
|
||||
|
||||
import Prelude
|
||||
import Control.Monad.Eff (Eff)
|
||||
import Control.Monad.Eff.Console (CONSOLE, logShow, log)
|
||||
import Control.Stream (STREAM, periodic, constant, scan, tapEvent, tapEnd, drain)
|
||||
import Data.Unit (Unit)
|
||||
|
||||
main :: Eff (stream :: STREAM, console :: CONSOLE) Unit
|
||||
main = do
|
||||
periodic 1000.0 -- Stream Unit
|
||||
# constant 1 -- Stream Int
|
||||
# scan (+) 0 -- Stream Int
|
||||
# tapEvent logShow -- Perform side-effects on events
|
||||
# tapEnd (log "done") -- Perform a side-effect on stream completion
|
||||
# drain -- activate your stream
|
||||
```
|
Loading…
Reference in New Issue
Block a user