Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
schedule
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • fengzhaoyu
  • schedule
  • Repository

Switch branch/tag
  • schedule
  • utils
  • observer.js
Find file
BlameHistoryPermalink
  • fengzhaoyu's avatar
    feat: canhuiren · 8408b1db
    fengzhaoyu authored 5 years ago
    8408b1db
observer.js 345 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
class Observer {
    register(a) {
        if (this.array == null) {
            this.array = [];
        }
        this.array.push(a);
    }

    unregister() {
        this.array = []
    }

    notice(b) {
        for (let x of this.array) {
            x.notice(b);
        }
    }
}
let observer = new Observer()
export default { observer }
×

Replace observer.js

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.