Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptionsManager 核心說明 #13

Open
hinablue opened this issue May 13, 2014 · 0 comments
Open

OptionsManager 核心說明 #13

hinablue opened this issue May 13, 2014 · 0 comments

Comments

@hinablue
Copy link
Owner

OptionsManager 是一個讓你放資料的地方,奇妙的是他因為有 EventHandler 可以用,所以本身也能夠觸發監聽事件。

OptionsManager 核心

他只能接收 JSON 格式的物件(Object),所以你亂丟東西他是不會收的。由於自己擁有一個 EventHandler 所以也可以綁定或是觸發事件。

另外,這兩種東西不收,

  • Document Fragments
  • Functions

方法

  • patch 修改 options 當中的某個 key-value
  • setOptions 等同於 patch
  • key(identifier) 取得對應的 value 並返回 OptionsManager 格式的 Object
  • get(key) 取得對應的 key-value 並返回 value
  • getOptions 等同於 get
  • set(key, value) 設定一組 key-value
  • value 傳回 OptionsManager 所收到的數組(Object
  • on, removeListener, pipe, unpipe 控制事件的方法

觸發事件

  • change 事件,會由 patch, set 對外觸發該事件
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant