-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# purescript-virtual-dom | ||
|
||
[virtual-dom](https://github.com/Matt-Esch/virtual-dom) bindings for PureScript | ||
[virtual-dom](https://github.com/Matt-Esch/virtual-dom) bindings for PureScript. | ||
|
||
This library is only aiming to provide basic `virtual-dom` functionality, with the intention that user-friendly libraries will be built on top of it to provide stronger typing, a `VTree` DSL, etc. | ||
|
||
- [Module documentation](docs/Module.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Module Documentation | ||
|
||
## Module VirtualDOM | ||
|
||
### Types | ||
|
||
PatchObject represents an Array<VPatch>, where each VPatch is a patch | ||
operation. See virtual-dom/docs.jsig for details. | ||
|
||
data PatchObject :: * | ||
|
||
|
||
### Type Class Instances | ||
|
||
|
||
instance showPatchObject :: Show PatchObject | ||
|
||
|
||
### Values | ||
|
||
|
||
createElement :: VTree -> Node | ||
|
||
|
||
diff :: VTree -> VTree -> PatchObject | ||
|
||
|
||
patch :: forall e. PatchObject -> Node -> Eff (dom :: DOM | e) Node | ||
|
||
|
||
## Module VirtualDOM.VTree | ||
|
||
### Types | ||
|
||
|
||
type TagName = String | ||
|
||
|
||
data VHook :: * | ||
|
||
|
||
data VTree :: * | ||
|
||
|
||
### Type Class Instances | ||
|
||
|
||
instance showVHook :: Show VHook | ||
|
||
|
||
instance showVTree :: Show VTree | ||
|
||
|
||
### Values | ||
|
||
Render a VTree using custom logic function. The logic can examine the | ||
previous VTree before returning the new (or same) one. The result of the | ||
render function must be a vnode, vtext, or widget. This constraint is not | ||
enforced by the types. | ||
|
||
thunk :: (Maybe VTree -> VTree) -> VTree | ||
|
||
|
||
vhook :: forall props. { | props } -> VHook | ||
|
||
|
||
vnode :: forall props. TagName -> { | props } -> [VTree] -> VTree | ||
|
||
|
||
vtext :: String -> VTree | ||
|
||
|
||
widget :: forall props. { | props } -> VTree |