From 426edec7ce486ca825ebb7ebdd2485e01f9b22b7 Mon Sep 17 00:00:00 2001 From: gasman Date: Mon, 8 Dec 2014 11:46:17 -0800 Subject: [PATCH] Updated StreamField blocks API (markdown) --- StreamField-blocks-API.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/StreamField-blocks-API.md b/StreamField-blocks-API.md index 5365e56..047c37c 100644 --- a/StreamField-blocks-API.md +++ b/StreamField-blocks-API.md @@ -213,4 +213,11 @@ Return the Javascript parameter list (a string consisting of zero or more JS exp ### default -The default value for blocks of this type; used as the initial value for newly-created instances of this block. For our shopping list, this is `[]`. \ No newline at end of file +The default value for blocks of this type; used as the initial value for newly-created instances of this block. For our shopping list, this is `[]`. + +## Addendum + +Implementation details that should be covered here (but aren't totally set in stone yet): + +* Javascript API refactor - rather than two levels of indirection (meta-initialiser and initialiser), there's just an initialiser function that takes js_declaration_param and prefix as its two parameters +* BoundBlock as a helper; calls to js_declaration_param should be done as block_factory.bind(val, prefix).js_declaration_param() rather than block_factory.js_declaration_param(val) so that blocks can potentially subclass BoundBlock to carry extra data around