Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
corrections and formatting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jed committed Dec 6, 2010
1 parent 8be98d9 commit ea1a8f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -4,10 +4,10 @@ pbsb is a tiny javascript function that elegantly merges two common ideas in jav


## overview ## overview


var endpoint = new pbsb // create var endpoint = new pbsb // create


endpoint.set( value ) // set/publish endpoint.set( value ) // set (publish)
endpoint.get( callback ) // get/subscribe endpoint.get( callback ) // get (subscribe)
endpoint( valueOrCallback ) // infer get/set by argument endpoint( valueOrCallback ) // infer get/set by argument


## description ## description
Expand Down Expand Up @@ -42,7 +42,7 @@ create an endpoint:


create an endpoint with an initial value: create an endpoint with an initial value:


var endpoint = pbsb( value ) // if typeof val != "function" var endpoint = pbsb( value ) // if value is not a function


set the endpoint's value: set the endpoint's value:


Expand All @@ -59,8 +59,8 @@ let pbsb figure out if you want to get or set:
var log = function( x ){ console.log( x ) } var log = function( x ){ console.log( x ) }
var val = "this is not a function" var val = "this is not a function"


endpoint( val ) // typeof val != "function", so endpoint.set( val ) endpoint( val ) // val is not a function, so endpoint.set( val )
endpoint( log ) // typeof val == "function", so endpoint.get( val ) endpoint( log ) // log is a function, so endpoint.get( log )


get the endpoint's current value AND subscribe to updates: get the endpoint's current value AND subscribe to updates:


Expand Down

0 comments on commit ea1a8f9

Please sign in to comment.